Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
socket: Prevent buffer under-read in nxt_inet_addr()
This was found via ASan. Given a listener address like ":" (or any address where the first character is a colon) we can end up under-reading the addr->start buffer here if (nxt_slow_path(*(buf + length - 1) == '.')) { due to length (essentially the position of the ":" in the string) being 0. Seeing as any address that starts with a ":" is invalid Unit config wise, we should simply reject the address if length == 0 in nxt_sockaddr_inet_parse(). Link: <https://clang.llvm.org/docs/AddressSanitizer.html> Signed-off-by: Arjun <[email protected]> [ Commit message - Andrew ] Signed-off-by: Andrew Clayton <[email protected]>
- Loading branch information