diff options
author | delphij <delphij@FreeBSD.org> | 2007-06-14 07:13:28 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2007-06-14 07:13:28 +0000 |
commit | 687b4ebc1a6ad4c42fd9c704edd2eeb36d700ba4 (patch) | |
tree | 5499a5a1c9adc888dfad16a42918098269cca4c5 /lib/libc/inet | |
parent | 9790f8d691dfa4d3c180c16eb2987d4963e7e5c8 (diff) | |
download | FreeBSD-src-687b4ebc1a6ad4c42fd9c704edd2eeb36d700ba4.zip FreeBSD-src-687b4ebc1a6ad4c42fd9c704edd2eeb36d700ba4.tar.gz |
Require users to provide a length information for inet_ntoa_r,
this is common on other platforms.
Reported by: pointyhat via kris
Diffstat (limited to 'lib/libc/inet')
-rw-r--r-- | lib/libc/inet/inet_ntoa.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/inet/inet_ntoa.c b/lib/libc/inet/inet_ntoa.c index b75a983..f5d69fa 100644 --- a/lib/libc/inet/inet_ntoa.c +++ b/lib/libc/inet/inet_ntoa.c @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * @@ -60,9 +60,10 @@ inet_ntoa(struct in_addr in) { } char * -inet_ntoa_r(struct in_addr in, char *buf) +inet_ntoa_r(struct in_addr in, char *buf, socklen_t size) { - (void) inet_ntop(AF_INET, &in, buf, sizeof("255.255.255.255")); + + (void) inet_ntop(AF_INET, &in, buf, size); return (buf); } |