mirror of
https://github.com/nginx/nginx.git
synced 2025-06-12 21:52:41 +08:00
A bounds check of %N format on Windows.
Thanks to Joe Bialek, Adam Zabrocki and Microsoft Vulnerability Research.
This commit is contained in:
parent
7e1eba5faa
commit
415c8ec4b4
@ -429,8 +429,12 @@ ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args)
|
|||||||
case 'N':
|
case 'N':
|
||||||
#if (NGX_WIN32)
|
#if (NGX_WIN32)
|
||||||
*buf++ = CR;
|
*buf++ = CR;
|
||||||
#endif
|
if (buf < last) {
|
||||||
|
*buf++ = LF;
|
||||||
|
}
|
||||||
|
#else
|
||||||
*buf++ = LF;
|
*buf++ = LF;
|
||||||
|
#endif
|
||||||
fmt++;
|
fmt++;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user