Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 19 Jan 2016 19:14:56 +0300
From: Alexander Cherepanov <ch3root@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: [PATCH] episerver: remove gratuitous memset in hash_type

Hi!

Commit 0bddce4a741503ca92cb5e73639faf0034652444 added a couple of 
memsets to clean struct custom_salt in episerver format. The second one 
is unnecessary because it cleans a pointer to struct not the struct 
itself. A patch to remove this memset is attached.

-- 
Alexander Cherepanov

>From e6d607eba31c120349075b4b69887484c5cfa7ef Mon Sep 17 00:00:00 2001
From: Alexander Cherepanov <cherepan@...me.ru>
Date: Tue, 19 Jan 2016 18:58:58 +0300
Subject: [PATCH] episerver: remove gratuitous memset in hash_type

---
 src/episerver_fmt_plug.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/episerver_fmt_plug.c b/src/episerver_fmt_plug.c
index 5015c36..3027aa9 100644
--- a/src/episerver_fmt_plug.c
+++ b/src/episerver_fmt_plug.c
@@ -584,10 +584,8 @@ static char *get_key(int index)
 /* report hash type: 1 SHA1, 2 SHA256 */
 static unsigned int hash_type(void *salt)
 {
-	struct custom_salt *my_salt;
+	struct custom_salt *my_salt = salt;
 
-	memset(&my_salt, 0, sizeof(my_salt));
-	my_salt = salt;
 	return (unsigned int) (1 + my_salt->version);
 }
 struct fmt_main fmt_episerver = {
-- 
1.7.10.4


Powered by blists - more mailing lists

Your e-mail address:

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