mirror of
https://github.com/sheumann/hush.git
synced 2025-01-12 14:30:54 +00:00
Patch from vodz to cleanup libbb/obscure.c:password_check()
to not copy too much data.
This commit is contained in:
parent
5378fbcb33
commit
481772a4c2
@ -144,8 +144,8 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
|
|||||||
|
|
||||||
msg = NULL;
|
msg = NULL;
|
||||||
newmono = str_lower(bb_xstrdup(newval));
|
newmono = str_lower(bb_xstrdup(newval));
|
||||||
lenwrap = strlen(old) * 2 + 1;
|
lenwrap = strlen(old);
|
||||||
wrapped = (char *) xmalloc(lenwrap);
|
wrapped = (char *) xmalloc(lenwrap * 2 + 1);
|
||||||
str_lower(strcpy(wrapped, old));
|
str_lower(strcpy(wrapped, old));
|
||||||
|
|
||||||
if (palindrome(newmono))
|
if (palindrome(newmono))
|
||||||
@ -164,7 +164,7 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bzero(newmono, strlen(newmono));
|
bzero(newmono, strlen(newmono));
|
||||||
bzero(wrapped, lenwrap);
|
bzero(wrapped, lenwrap * 2);
|
||||||
free(newmono);
|
free(newmono);
|
||||||
free(wrapped);
|
free(wrapped);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user