at most 4 hexadecimal digits are processed in one field so the
value cannot overflow. the netdb.h header was not used.
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
}
for (v=j=0; j<4 && (d=hexval(s[j]))>=0; j++)
v=16*v+d;
}
for (v=j=0; j<4 && (d=hexval(s[j]))>=0; j++)
v=16*v+d;
- if (j==0 || v > 65535) return 0;
ip[i] = v;
if (!s[j] && (brk>=0 || i==7)) break;
if (i==7) return 0;
ip[i] = v;
if (!s[j] && (brk>=0 || i==7)) break;
if (i==7) return 0;