Skip to content

Commit 9587f31

Browse files
author
=
committed
fixed hcx-max
1 parent 6f2bcb7 commit 9587f31

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

hcxhashtool.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ johnpmkidwrittencount = 0;
197197
johneapolwrittencount = 0;
198198
hccapxwrittencount = 0;
199199
hccapwrittencount = 0;
200-
if((hashlist = (hashlist_t*)calloc(hashlistcount, HASHLIST_SIZE)) == NULL) return false;
200+
if((hashlist = (hashlist_t*)calloc(hashlistcount, HASHLIST_SIZE +1)) == NULL) return false;
201201
if((ouilist = (ouilist_t*)calloc(ouilistcount, OUILIST_SIZE)) == NULL) return false;
202202

203203
ERR_load_crypto_strings();
@@ -1223,7 +1223,6 @@ static FILE *fh_pmkideapol;
12231223
static hashlist_t *zeiger;
12241224
static hashlist_t *zeiger2;
12251225
static hashlist_t *zeigerbegin;
1226-
static hashlist_t *zeigerend;
12271226
static struct stat statinfo;
12281227

12291228
if(lcmax == 0) lcmax = pmkideapolcount;
@@ -1239,21 +1238,17 @@ if(pmkideapoloutname != NULL)
12391238
qsort(hashlist, pmkideapolcount, HASHLIST_SIZE, sort_hashlist_by_essid);
12401239
zeigerbegin = hashlist;
12411240
lc = 0;
1242-
for(zeiger = hashlist +1; zeiger < hashlist +pmkideapolcount; zeiger++)
1241+
for(zeiger = hashlist +1; zeiger < hashlist +pmkideapolcount +1; zeiger++)
12431242
{
1244-
if(memcmp(zeigerbegin->essid, zeiger->essid, ESSID_LEN_MAX) == 0)
1245-
{
1246-
zeigerend = zeiger;
1247-
lc++;
1248-
}
1243+
if(memcmp(zeigerbegin->essid, zeiger->essid, ESSID_LEN_MAX) == 0) lc++;
12491244
else
12501245
{
1251-
if(((zeigerend -zeigerbegin) >= lcmin) && ((zeigerend -zeigerbegin) <= lcmax))
1246+
if((lc >= lcmin) && (lc <= lcmax))
12521247
{
1253-
for(zeiger2 = zeigerbegin; zeiger2 <= zeigerend; zeiger2++) writepmkideapolhashline(fh_pmkideapol, zeiger2);
1248+
for(zeiger2 = zeigerbegin; zeiger2 < zeiger; zeiger2++) writepmkideapolhashline(fh_pmkideapol, zeiger2);
12541249
}
1255-
lc = 0;
12561250
zeigerbegin = zeiger;
1251+
lc = 0;
12571252
}
12581253
}
12591254
if(fh_pmkideapol != NULL) fclose(fh_pmkideapol);

0 commit comments

Comments
 (0)