diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2023-11-08 15:03:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-08 15:03:29 (GMT) |
commit | fe3fd2c333ac080dba1fa64452c2f62098107731 (patch) | |
tree | 0ab62321fe52e7843b299e1c73f6e8b94d72efe7 /Modules/clinic | |
parent | 8ab7ad63086b1793c24b1c5aaa19b60fc0e6540e (diff) | |
download | cpython-fe3fd2c333ac080dba1fa64452c2f62098107731.zip cpython-fe3fd2c333ac080dba1fa64452c2f62098107731.tar.gz cpython-fe3fd2c333ac080dba1fa64452c2f62098107731.tar.bz2 |
socket: Update generated AC code (#111853)
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/socketmodule.c.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/clinic/socketmodule.c.h b/Modules/clinic/socketmodule.c.h index 35019e7..3f4056e 100644 --- a/Modules/clinic/socketmodule.c.h +++ b/Modules/clinic/socketmodule.c.h @@ -170,10 +170,15 @@ _socket_socket_inet_aton(PySocketSockObject *self, PyObject *arg) _PyArg_BadArgument("inet_aton", "argument", "str", arg); goto exit; } - ip_addr = PyUnicode_AsUTF8(arg); + Py_ssize_t ip_addr_length; + ip_addr = PyUnicode_AsUTF8AndSize(arg, &ip_addr_length); if (ip_addr == NULL) { goto exit; } + if (strlen(ip_addr) != (size_t)ip_addr_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } return_value = _socket_socket_inet_aton_impl(self, ip_addr); exit: @@ -254,4 +259,4 @@ exit: #ifndef _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #endif /* !defined(_SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF) */ -/*[clinic end generated code: output=a6621b09bcb88f6b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=eb37b5d88a1e4661 input=a9049054013a1b77]*/ |