secure_snprintf.patch 854 B

123456789101112131415
  1. With format string strictness, High Sierra also enforces that %n isn't used
  2. in dynamic format strings, but we should just disable its use on darwin in
  3. general.
  4. --- a/lib/vasnprintf.c.orig 2017-06-22 15:19:15.000000000 -0700
  5. +++ b/lib/vasnprintf.c 2017-06-22 15:20:20.000000000 -0700
  6. @@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
  7. #endif
  8. *fbp = dp->conversion;
  9. #if USE_SNPRINTF
  10. -# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
  11. +# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
  12. fbp[1] = '%';
  13. fbp[2] = 'n';
  14. fbp[3] = '\0';