aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/obscure.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libbb/obscure.c b/libbb/obscure.c
index 537d4484f..aa15e4097 100644
--- a/libbb/obscure.c
+++ b/libbb/obscure.c
@@ -144,8 +144,8 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
144 144
145 msg = NULL; 145 msg = NULL;
146 newmono = str_lower(bb_xstrdup(newval)); 146 newmono = str_lower(bb_xstrdup(newval));
147 lenwrap = strlen(old) * 2 + 1; 147 lenwrap = strlen(old);
148 wrapped = (char *) xmalloc(lenwrap); 148 wrapped = (char *) xmalloc(lenwrap * 2 + 1);
149 str_lower(strcpy(wrapped, old)); 149 str_lower(strcpy(wrapped, old));
150 150
151 if (palindrome(newmono)) 151 if (palindrome(newmono))
@@ -164,7 +164,7 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
164 } 164 }
165 165
166 bzero(newmono, strlen(newmono)); 166 bzero(newmono, strlen(newmono));
167 bzero(wrapped, lenwrap); 167 bzero(wrapped, lenwrap * 2);
168 free(newmono); 168 free(newmono);
169 free(wrapped); 169 free(wrapped);
170 170