← Commit list

481772a4c

Eric Andersen
Eric Andersen
2003-08-06
FAILED Duration: 88s

Subject

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

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/obscure.c+3 -3
@@ -144,8 +144,8 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
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 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
}
bzero(newmono, strlen(newmono));
- bzero(wrapped, lenwrap);
+ bzero(wrapped, lenwrap * 2);
free(newmono);
free(wrapped);