summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Neulinger <nneul@neulinger.org>2014-10-05 15:49:35 +0000
committerNathan Neulinger <nneul@neulinger.org>2014-10-05 15:49:35 +0000
commit783201122d829d9e2beb5c3e61157d2037d4776c (patch)
treeaec4fcaaee856ff4130ac3a40b37b1c77bd0dfdd
parent93ce8f978e546b0e03a58fbdc18b7845637a84d4 (diff)
downloadcracklib-783201122d829d9e2beb5c3e61157d2037d4776c.tar.gz
bug 16 - prevblock checking is causing incorrect results, looks to be a perf optimization gone awry. Thanks to Russ Allbery for the report. Debian bug # 724570
git-svn-id: file:///tmp/cracklib-svn/trunk@231 4175fe1e-86d5-4fdc-8e6a-506fab9d8533
-rw-r--r--cracklib/lib/packlib.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/cracklib/lib/packlib.c b/cracklib/lib/packlib.c
index 20b1388..f851424 100644
--- a/cracklib/lib/packlib.c
+++ b/cracklib/lib/packlib.c
@@ -446,19 +446,10 @@ GetPW(pwp, number)
register char *nstr;
register char *bptr;
char buffer[NUMWORDS * MAXWORDLEN];
- static uint32_t prevblock = 0xffffffff;
uint32_t thisblock;
thisblock = number / NUMWORDS;
- if (prevblock == thisblock)
- {
-#if DEBUG
- fprintf(stderr, "returning (%s)\n", pwp->data_get[number % NUMWORDS]);
-#endif
- return (pwp->data_get[number % NUMWORDS]);
- }
-
if (_PWIsBroken64(pwp->ifp))
{
uint64_t datum64;
@@ -526,8 +517,6 @@ GetPW(pwp, number)
return NULL;
}
- prevblock = thisblock;
-
bptr = buffer;
for (ostr = pwp->data_get[0]; (*(ostr++) = *(bptr++)); /* nothing */ );