mirror of
https://github.com/nginx/nginx.git
synced 2024-11-24 04:49:01 +08:00
QUIC: better sockaddr initialization.
The qsock->sockaddr field is a ngx_sockaddr_t union, and therefore can hold any sockaddr (and union members, such qsock->sockaddr.sockaddr, can be used to access appropriate variant of the sockaddr). It is better to set it via qsock->sockaddr itself though, and not qsock->sockaddr.sockaddr, so static analyzers won't complain about out-of-bounds access. Prodded by Coverity (CID 1530403).
This commit is contained in:
parent
4b02661748
commit
0400e3d5ce
@ -183,7 +183,7 @@ ngx_quic_recvmsg(ngx_event_t *ev)
|
|||||||
|
|
||||||
qsock = ngx_quic_get_socket(c);
|
qsock = ngx_quic_get_socket(c);
|
||||||
|
|
||||||
ngx_memcpy(&qsock->sockaddr.sockaddr, sockaddr, socklen);
|
ngx_memcpy(&qsock->sockaddr, sockaddr, socklen);
|
||||||
qsock->socklen = socklen;
|
qsock->socklen = socklen;
|
||||||
|
|
||||||
c->udp->buffer = &buf;
|
c->udp->buffer = &buf;
|
||||||
|
Loading…
Reference in New Issue
Block a user