Off-by-one buffer overflow error.

This commit is contained in:
Armin Rigo 2006-04-12 11:59:26 +00:00
parent bc96609555
commit 2db15505be
1 changed files with 1 additions and 1 deletions

View File

@ -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;