Skip to content
Snippets Groups Projects
Commit 5a5f5bb2 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

NULL check _tc and _setup even for data packets.

Our documentation says we will, so we should.

Thanks to Chris Peterson for the report.

Fixes #2279.
parent 50df9336
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,14 @@ static int oc_dec_headerin(oc_pack_buf *_opb,th_info *_info,
packtype=(int)val;
/*If we're at a data packet and we have received all three headers, we're
done.*/
if(!(packtype&0x80)&&_info->frame_width>0&&_tc->vendor!=NULL&&*_setup!=NULL){
if(!(packtype&0x80)&&_info->frame_width>0){
/*Our documentation says we'll return TH_EFAULT if these are NULL, so let's
check.*/
if(_tc==NULL||_setup==NULL)return TH_EFAULT;
/*Otherwise, if we didn't get all of the headers, this was not the next
packet in the expected sequence.*/
else if(_tc->vendor==NULL||*_setup==NULL)return TH_EBADHEADER;
/*Otherwise, we're done.*/
return 0;
}
/*Check the codec string.*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment