[libsoup] soup-auth-digest: Fix buffer size issue found by Coverity Scan and clang
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] soup-auth-digest: Fix buffer size issue found by Coverity Scan and clang
- Date: Mon, 25 Jun 2018 14:13:32 +0000 (UTC)
commit 2d4efd22ae39d862978ed1434286fe66d8577fa5
Author: Milan Crha <mcrha redhat com>
Date: Mon Jun 25 16:15:41 2018 +0200
soup-auth-digest: Fix buffer size issue found by Coverity Scan and clang
https://bugzilla.gnome.org/show_bug.cgi?id=781771
libsoup/soup-auth-digest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/soup-auth-digest.c b/libsoup/soup-auth-digest.c
index eda2a93c..e8ba9903 100644
--- a/libsoup/soup-auth-digest.c
+++ b/libsoup/soup-auth-digest.c
@@ -343,7 +343,7 @@ soup_auth_digest_compute_response (const char *method,
g_checksum_update (checksum, (guchar *)method, strlen (method));
g_checksum_update (checksum, (guchar *)":", 1);
g_checksum_update (checksum, (guchar *)uri, strlen (uri));
- strncpy (hex_a2, g_checksum_get_string (checksum), 33);
+ memcpy (hex_a2, g_checksum_get_string (checksum), sizeof (char) * 33);
g_checksum_free (checksum);
/* compute KD */
@@ -369,7 +369,7 @@ soup_auth_digest_compute_response (const char *method,
}
g_checksum_update (checksum, (guchar *)hex_a2, 32);
- strncpy (response, g_checksum_get_string (checksum), 33);
+ memcpy (response, g_checksum_get_string (checksum), sizeof (char) * 33);
g_checksum_free (checksum);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]