This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

64-bit snprintf/vsnprintf overflow condition


Hi,

It looks like the overflow condition in vsnprintf/snprintf is unnecessarily restrictive for 64-bit architectures.

from libc/stdio/snprintf.c:
 52  if (size > INT_MAX)
 53    {
 54      ptr->_errno = EOVERFLOW;
 55      return EOF;
 56    }

I believe it should use SIZE_MAX, rather than INT_MAX.

-David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]