[PATCH] Fix wrong buffer size supplied to memset()
- From: Thomas Jarosch <thomas jarosch intra2net com>
- To: networkmanager-list gnome org
- Subject: [PATCH] Fix wrong buffer size supplied to memset()
- Date: Tue, 25 Dec 2012 14:40:08 +0100
cppcheck reported:
[src/dns-manager/nm-dns-manager.c:565]: (error) Using 'sizeof'
on array given as function argument returns size of a pointer.
Signed-off-by: Thomas Jarosch <thomas jarosch intra2net com>
---
src/dns-manager/nm-dns-manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
index 38691f3..381622a 100644
--- a/src/dns-manager/nm-dns-manager.c
+++ b/src/dns-manager/nm-dns-manager.c
@@ -562,7 +562,7 @@ compute_hash (NMDnsManager *self, guint8 buffer[HASH_LEN])
nm_ip6_config_hash (NM_IP6_CONFIG (iter->data), sum, TRUE);
}
- memset (buffer, 0, sizeof (buffer));
+ memset (buffer, 0, sizeof (guint8) * HASH_LEN);
g_checksum_get_digest (sum, buffer, &len);
g_checksum_free (sum);
}
--
1.7.11.7
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]