mirror of https://github.com/python/cpython
Off-by-one buffer overflow error.
This commit is contained in:
parent
bc96609555
commit
2db15505be
|
@ -1098,7 +1098,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
|
|||
addr = (struct sockaddr_un*)&(s->sock_addr).un;
|
||||
if (!PyArg_Parse(args, "t#", &path, &len))
|
||||
return 0;
|
||||
if (len > sizeof addr->sun_path) {
|
||||
if (len >= sizeof addr->sun_path) {
|
||||
PyErr_SetString(socket_error,
|
||||
"AF_UNIX path too long");
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue