711. [bug] The libisc and liblwres implementations of
inet_ntop contained an off by one error.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
|
||||
711. [bug] The libisc and liblwres implementations of
|
||||
inet_ntop contained an off by one error.
|
||||
|
||||
710. [func] The forwarders statement now takes an optional port.
|
||||
|
||||
709. [bug] ANY or SIG queries for data with a TTL of 0
|
||||
|
||||
+4
-3
@@ -17,7 +17,7 @@
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char rcsid[] =
|
||||
"$Id: inet_ntop.c,v 1.10 2001/01/09 21:56:07 bwelling Exp $";
|
||||
"$Id: inet_ntop.c,v 1.11 2001/01/25 19:39:48 bwelling Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <config.h>
|
||||
@@ -86,7 +86,8 @@ inet_ntop4(const unsigned char *src, char *dst, size_t size)
|
||||
static const char *fmt = "%u.%u.%u.%u";
|
||||
char tmp[sizeof "255.255.255.255"];
|
||||
|
||||
if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) > size) {
|
||||
if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size)
|
||||
{
|
||||
errno = ENOSPC;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -183,7 +184,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
||||
/*
|
||||
* Check for overflow, copy, and we're done.
|
||||
*/
|
||||
if ((size_t)(tp - tmp) > size) {
|
||||
if ((size_t)(tp - tmp) >= size) {
|
||||
errno = ENOSPC;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char rcsid[] =
|
||||
"$Id: lwinetntop.c,v 1.6 2001/01/09 21:59:26 bwelling Exp $";
|
||||
"$Id: lwinetntop.c,v 1.7 2001/01/25 19:39:47 bwelling Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <config.h>
|
||||
@@ -84,7 +84,8 @@ inet_ntop4(const unsigned char *src, char *dst, size_t size) {
|
||||
static const char *fmt = "%u.%u.%u.%u";
|
||||
char tmp[sizeof "255.255.255.255"];
|
||||
|
||||
if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) > size) {
|
||||
if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size)
|
||||
{
|
||||
errno = ENOSPC;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -180,7 +181,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size) {
|
||||
/*
|
||||
* Check for overflow, copy, and we're done.
|
||||
*/
|
||||
if ((size_t)(tp - tmp) > size) {
|
||||
if ((size_t)(tp - tmp) >= size) {
|
||||
errno = ENOSPC;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user