Welcome! Log In Create A New Profile

Advanced

About the UNIX socket path length check

Peter Wu
October 09, 2014 12:04PM
Hi,

In src/core/ngx_inet.c we have this code:

if (len > sizeof(saun->sun_path)) {
u->err = "too long path in the unix domain socket";
return NGX_ERROR;
}

But a NUL-terminated string requires one byte more. Is it allowed to
omit the NUL byte when the string would not fit otherwise? If not,
this should be changed to:

if (len >= sizeof(saun->sun_path)) {
u->err = "too long path in the unix domain socket";
return NGX_ERROR;
}

--
Kind regards,
Peter
https://lekensteyn.nl

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

About the UNIX socket path length check

Peter Wu 923 October 09, 2014 12:04PM

Re: About the UNIX socket path length check

Ruslan Ermilov 321 October 09, 2014 12:42PM

Re: About the UNIX socket path length check

Peter Wu 342 October 19, 2014 09:16AM

Re: About the UNIX socket path length check

Maxim Dounin 302 October 09, 2014 01:14PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready