]> git.kaiwu.me - nginx.git/commit
Events: fixed handling zero-length client address.
authorRoman Arutyunyan <arut@nginx.com>
Fri, 1 Jun 2018 13:53:02 +0000 (16:53 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Fri, 1 Jun 2018 13:53:02 +0000 (16:53 +0300)
commitb1d88228ecb54140ec1f7d3f11f0fbb4d6ec5982
treee592fc1670f03fa72da1a23188a848a45f6cc30c
parentb0e5144c6d5096ad6220816854da4411a218f82c
Events: fixed handling zero-length client address.

On Linux recvmsg() syscall may return a zero-length client address when
receiving a datagram from an unbound unix datagram socket.  It is usually
assumed that socket address has at least the sa_family member.  Zero-length
socket address caused buffer over-read in functions which receive socket
address, for example ngx_sock_ntop().  Typically the over-read resulted in
unexpected socket family followed by session close.  Now a fake socket address
is allocated instead of a zero-length client address.
src/event/ngx_event_accept.c