This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: socket.inet_aton() succeeds on invalid input
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: loewis, mbeaumon
Priority: normal Keywords:

Created on 2003-01-17 17:49 by mbeaumon, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Messages (2)
msg14117 - (view) Author: Matt Beaumont (mbeaumon) Date: 2003-01-17 17:49
Given a string such as "5.6.7", inet_aton() returns
'\x05\x06\x00\x07'.  In C (using libraries installed
with RedHat 7.2), the equivalent call returns 0,
indicating that the address is invalid.
msg14118 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-01-19 17:38
Logged In: YES 
user_id=21627

I can't see the problem. First, 5.6.7 is really a valid
denotation of an IP number, and denotes the IP address
5.6.0.7, just like 10.13 denotes 10.0.0.13.

Furthermore, Python uses inet_addr on the C level, which
does not return a status; for the address given, it returns
exactly the same result that you see in Python.

Finally, I cannot reproduce inet_aton(3) returning an error:
on my installation (SuSE 8.1), it returns 1, indicating success.
History
Date User Action Args
2022-04-10 16:06:09adminsetgithub: 37791
2003-01-17 17:49:26mbeaumoncreate