A bounds check of %N format on Windows.

Thanks to Joe Bialek, Adam Zabrocki and Microsoft Vulnerability Research.
This commit is contained in:
Igor Sysoev 2015-01-27 15:38:15 +03:00
parent 7e1eba5faa
commit 415c8ec4b4

View File

@ -429,8 +429,12 @@ ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args)
case 'N':
#if (NGX_WIN32)
*buf++ = CR;
#endif
if (buf < last) {
*buf++ = LF;
}
#else
*buf++ = LF;
#endif
fmt++;
continue;