New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socketmodule.c: inet_pton() expects 4-byte packed_addr #38406
Comments
In the Modules/socketmodule.c file, the inet_pton function
implicitly treats "long packed_addr" as a 4-byte object or
expects that the required 4-bytes is at
&packed_addr[0]-[3]. This is not true under
SUPER-UX/SX. In order to get this working right, I
changed the data type from "long" to "int". This now
works properly.
-----Modules/socketmodule.c: python/issues-test-cpython#3825
/* 042303; JM; this routine really expects a 4-byte
packed_addr
* not a long; long on SX is 8-bytes! */
#if SX
int packed_addr;
#else
long packed_addr;
#endif
...
if (packed_addr == INADDR_NONE)
return 0;
memcpy(dst, &packed_addr, 4);
----- |
Logged In: YES Attached is a patch which should fix the problem. There was |
Logged In: YES Please, could you verify if this problem persists in Python 2.3.4 If yes, in which version? Can you provide a test case? If the problem is solved, from which version? Note that if you fail to answer in one month, I'll close this bug Thank you! . Facundo |
Logged In: YES This patch is no applied, the bug persists? |
Logged In: YES I no longer have access to SUPER-UX/SX systems, but The more general patch supplied by nnorwitz should Thanks, |
Logged In: YES Deprecated. Reopen only if still happens in 2.3 or newer. . Facundo |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: