mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
Fix undefined behaviour in fastcgi.c (#14269)
Arithmetic on NULL pointers is undefined.
This commit is contained in:
parent
a59868aef8
commit
ad5138a341
@ -744,7 +744,7 @@ int fcgi_listen(const char *path, int backlog)
|
||||
memset(&sa.sa_unix, 0, sizeof(sa.sa_unix));
|
||||
sa.sa_unix.sun_family = AF_UNIX;
|
||||
memcpy(sa.sa_unix.sun_path, path, path_len + 1);
|
||||
sock_len = (size_t)(((struct sockaddr_un *)0)->sun_path) + path_len;
|
||||
sock_len = XtOffsetOf(struct sockaddr_un, sun_path) + path_len;
|
||||
#ifdef HAVE_SOCKADDR_UN_SUN_LEN
|
||||
sa.sa_unix.sun_len = sock_len;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user