[BusyBox-cvs] busybox/libbb obscure.c,1.4,1.5

Erik Andersen andersen at busybox.net
Wed Aug 6 08:33:11 UTC 2003


Update of /var/cvs/busybox/libbb
In directory winder:/tmp/cvs-serv17862/libbb

Modified Files:
	obscure.c 
Log Message:
Patch from vodz to cleanup libbb/obscure.c:password_check()
to not copy too much data.


Index: obscure.c
===================================================================
RCS file: /var/cvs/busybox/libbb/obscure.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- obscure.c	30 Jul 2003 07:57:06 -0000	1.4
+++ obscure.c	6 Aug 2003 08:33:08 -0000	1.5
@@ -144,8 +144,8 @@
 
 	msg = NULL;
 	newmono = str_lower(bb_xstrdup(newval));
-	lenwrap = strlen(old) * 2 + 1;
-	wrapped = (char *) xmalloc(lenwrap);
+	lenwrap = strlen(old);
+	wrapped = (char *) xmalloc(lenwrap * 2 + 1);
 	str_lower(strcpy(wrapped, old));
 
 	if (palindrome(newmono))
@@ -164,7 +164,7 @@
 	}
 
 	bzero(newmono, strlen(newmono));
-	bzero(wrapped, lenwrap);
+	bzero(wrapped, lenwrap * 2);
 	free(newmono);
 	free(wrapped);
 




More information about the busybox-cvs mailing list