bryancall opened a new pull request, #13933:
URL: https://github.com/apache/trafficserver/pull/13933

   `ats_ip_pton()` takes a `std::string_view` but parsed the port with 
`atoi()`, which keeps reading until it finds a non-digit. When the port digits 
are the last bytes of the input, it reads past the end of the view, into 
whatever follows it or past the end of the buffer. A view of `1.2.3.4:80` taken 
from `1.2.3.4:8099` came back with port 8099. The IP parsing fuzzer proposed in 
#13903 found it.
   
   This parses the port with `swoc::svtoi()` over the view instead, in base 10 
so a leading zero is not read as octal. Every in-bounds input gets the same 
port as before, including empty, non-numeric and out-of-range ports, which the 
new unit tests pin down along with the end-of-buffer case.
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to