Skip to content

Commit

Permalink
[PATCH] net: allow newline terminated IP addresses in in_aton
Browse files Browse the repository at this point in the history
in_aton() gives weird results if it sees a newline at the end of the
input. This patch makes it able to handle such input correctly.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Mitch Williams authored and John W. Linville committed Nov 13, 2005
1 parent cd52d1e commit 1e2e565
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ __u32 in_aton(const char *str)
if (*str != '\0')
{
val = 0;
while (*str != '\0' && *str != '.')
while (*str != '\0' && *str != '.' && *str != '\n')
{
val *= 10;
val += *str - '0';
Expand Down

0 comments on commit 1e2e565

Please sign in to comment.