[Python-bugs-list] [ python-Bugs-784031 ] Byte-order bug in socket-module getaddrinfo.c

SourceForge.net noreply@sourceforge.net
Wed, 06 Aug 2003 02:07:23 -0700


Bugs item #784031, was opened at 2003-08-06 12:07
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=784031&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Tuomo Hyyrylainen (therry)
Assigned to: Nobody/Anonymous (nobody)
Summary: Byte-order bug in socket-module getaddrinfo.c

Initial Comment:
It seems to me that there is a byte-order bug in
Modules/getaddrinfo.c, in function getaddrinfo.
On line 415 inet_pton is called, and that is supposed
to return IPv4 address in network byte order. So
the code below in case block (AF_INET) does not
work correctly on little-endian platforms.

I would propose adding line

v4a = ntohl(v4a);

between current lines 423 and 424.

--
Tuomo Hyyrylainen


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=784031&group_id=5470