ezelkow1 commented on issue #4531: Astats plugin - Add null check around 
strtok_r token usage
URL: https://github.com/apache/trafficcontrol/pull/4531#issuecomment-602930463
 
 
   > 
   > 
   > This is being done in a lot of other places in that file, is there a 
reason this line in particular is a problem?
   
   Its because of the usage of tok1. So all the other usages of strtok_r in 
there are taking a single pointer for the save value, and then just iterating 
over strtok_r until it returns null.  However in these 2 instances they are 
re-using the tok1 value from previous strtok_r calls.  Strtok_r can return a 
null value if it doesnt find the string its looking for
   
   So in these 2 instances its possible that the first call to strtok_r will 
have returned a null value, and then you are using an explicit null pointer as 
the save value

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to