lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #9041] ipaddr_aton: Accept URI-style termination


From: Sylvain Rochet
Subject: [lwip-devel] [patch #9041] ipaddr_aton: Accept URI-style termination
Date: Wed, 6 Jul 2016 11:49:28 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #3, patch #9041 (project lwip):

verbatim+

It doesn't work.

#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>


int main() {
        struct in_addr inaddr;
        printf("%d\n", inet_aton("192.168.0.1/index.html", &inaddr));
        printf("%.8x\n", inaddr.s_addr);
        printf("%d\n", inet_aton("192.168.0.1", &inaddr));
        printf("%.8x\n", inaddr.s_addr);
}


returns:

$ gcc -o test test.c && ./test 
0
7619a7d0
1
0100a8c0



inet_aton() returns 1 if the supplied string was successfully interpreted, or
0 if the string is invalid (errno is not set on error).


inet_aton() might be already used in the wild to check user input, therefore
the patch is probably not acceptable.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9041>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]