Skip to content

Commit

Permalink
improved IE-TAG error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Sep 9, 2024
1 parent 5251cc8 commit ae840b9
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions hcxpcapngtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -3176,7 +3176,11 @@ while(0 < infolen)
infolen -= tagptr->len +IETAG_SIZE;
continue;
}
if(tagptr->len > infolen) return false;
if(tagptr->len > infolen)
{
taglenerrorcount++;
return false;
}
if(tagptr->id == TAG_SSID)
{
if((tagok & TAG_SSID_OK) == 0)
Expand Down Expand Up @@ -3222,20 +3226,32 @@ while(0 < infolen)
{
if(tagptr->len >= RSNIE_LEN_MIN)
{
if(gettagrsn(tagptr->len, tagptr->data, zeiger) == false) return false;
if(gettagrsn(tagptr->len, tagptr->data, zeiger) == false)
{
taglenerrorcount++;
return false;
}
}
}
else if(tagptr->id == TAG_VENDOR)
{
if(tagptr->len >= VENDORIE_SIZE)
{
if(gettagvendor(tagptr->len, tagptr->data, zeiger) == false) return false;
if(gettagvendor(tagptr->len, tagptr->data, zeiger) == false)
{
taglenerrorcount++;
return false;
}
}
}
infoptr += tagptr->len +IETAG_SIZE;
infolen -= tagptr->len +IETAG_SIZE;
}
if((infolen != 0) && (infolen != 4) && (ef == false)) return false;
if((infolen != 0) && (infolen != 4) && (ef == false))
{
taglenerrorcount++;
return false;
}
return true;
}
/*===========================================================================*/
Expand Down

0 comments on commit ae840b9

Please sign in to comment.