Skip to content
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

socket.inet_aton() succeeds on invalid input #37791

Closed
mbeaumon mannequin opened this issue Jan 17, 2003 · 2 comments
Closed

socket.inet_aton() succeeds on invalid input #37791

mbeaumon mannequin opened this issue Jan 17, 2003 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@mbeaumon
Copy link
Mannequin

mbeaumon mannequin commented Jan 17, 2003

BPO 669859
Nosy @loewis

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:

assignee = None
closed_at = <Date 2003-01-19.17:38:41.000>
created_at = <Date 2003-01-17.17:49:26.000>
labels = ['invalid', 'library']
title = 'socket.inet_aton() succeeds on invalid input'
updated_at = <Date 2003-01-19.17:38:41.000>
user = 'https://bugs.python.org/mbeaumon'

bugs.python.org fields:

activity = <Date 2003-01-19.17:38:41.000>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2003-01-17.17:49:26.000>
creator = 'mbeaumon'
dependencies = []
files = []
hgrepos = []
issue_num = 669859
keywords = []
message_count = 2.0
messages = ['14117', '14118']
nosy_count = 2.0
nosy_names = ['loewis', 'mbeaumon']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue669859'
versions = ['Python 2.2']

@mbeaumon
Copy link
Mannequin Author

mbeaumon mannequin commented Jan 17, 2003

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.

@mbeaumon mbeaumon mannequin closed this as completed Jan 17, 2003
@mbeaumon mbeaumon mannequin added invalid stdlib Python modules in the Lib dir labels Jan 17, 2003
@loewis
Copy link
Mannequin

loewis mannequin commented Jan 19, 2003

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

0 participants