summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Modules/socketmodule.c
diff options
context:
space:
mode:
authorarcadia-devtools <[email protected]>2022-06-09 19:02:01 +0300
committerarcadia-devtools <[email protected]>2022-06-09 19:02:01 +0300
commit4a29d649866ff133e0b8f8a1009e1000a44d7279 (patch)
tree547229aded91b3760628c646a144af604f1c3e2b /contrib/tools/python3/src/Modules/socketmodule.c
parent782f2445a283aed9a66e699137b3349af1689c29 (diff)
intermediate changes
ref:478170c7a5a1c0788ddd0d6513ce4ed86d7d7c99
Diffstat (limited to 'contrib/tools/python3/src/Modules/socketmodule.c')
-rw-r--r--contrib/tools/python3/src/Modules/socketmodule.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/tools/python3/src/Modules/socketmodule.c b/contrib/tools/python3/src/Modules/socketmodule.c
index e1b8b13d883..32a11464834 100644
--- a/contrib/tools/python3/src/Modules/socketmodule.c
+++ b/contrib/tools/python3/src/Modules/socketmodule.c
@@ -1687,6 +1687,8 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
"AF_UNIX path too long");
goto unix_out;
}
+
+ *len_ret = path.len + offsetof(struct sockaddr_un, sun_path);
}
else
#endif /* linux */
@@ -1698,10 +1700,13 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
goto unix_out;
}
addr->sun_path[path.len] = 0;
+
+ /* including the tailing NUL */
+ *len_ret = path.len + offsetof(struct sockaddr_un, sun_path) + 1;
}
addr->sun_family = s->sock_family;
memcpy(addr->sun_path, path.buf, path.len);
- *len_ret = path.len + offsetof(struct sockaddr_un, sun_path);
+
retval = 1;
unix_out:
PyBuffer_Release(&path);