Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 6 Jul 2012 10:02:35 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: KRB4: fix memset in afs_cmu_StringToKey()

clang 3.0 correctly identified a problem here and issued a warning
[-Wsizeof-pointer-memaccess]

On linux-x86 (32bit), sizeof(key) is just 4, while sizeof(*key) is 8.

Attached patch fixes the problem.

Frank

>From 79d6b966940a6d33ac0dc27c9aa725b3827f46d9 Mon Sep 17 00:00:00 2001
From: Frank Dittrich <frank_dittrich@...mail.com>
Date: Fri, 6 Jul 2012 09:52:27 +0200
Subject: [PATCH] KRB4: fix memset in afs_cmu_StringToKey()

clang 3.0 correctly identified a problem here and issued a warning
[-Wsizeof-pointer-memaccess]
---
 src/KRB4_std_plug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/KRB4_std_plug.c b/src/KRB4_std_plug.c
index bbb21d9..b5904ac 100644
--- a/src/KRB4_std_plug.c
+++ b/src/KRB4_std_plug.c
@@ -50,7 +50,7 @@ afs_cmu_StringToKey (char *str, char *cell, DES_cblock *key)
     int   i;
     int   passlen;
 
-    memset(key, 0, sizeof(key));
+    memset(key, 0, sizeof(*key));
     memset(password, 0, sizeof(password));
 
     strncpy (password, cell, 8);
-- 
1.7.7.6


Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ