﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1072	Overflow in ngx_atosz with Visual Studio 2013 in 64bit system	ansarhun@…		"When I was trying to set Content-Length header from lua, I got an error that setting the header failed.

The error occured in 
{{{
ngx_http_set_content_length_header
}}}
, when it tried to parse the data with 
{{{
ngx_atosz
}}}
.

The ssize_t is defined as int which is 32bit in visual studio.
When setting the NGX_MAX_SIZE_T_VALUE value to a ssize_t variable it overflows, and checks fail with cutoff:

{{{
if (value >= cutoff && (value > cutoff || *line - '0' > cutlim)) {
}}}

Changing the define in ngx_win32_config.h to 
{{{
__int64
}}}
 solves the problem.


{{{
#ifndef __MINGW64_VERSION_MAJOR
typedef __int64                 ssize_t;
#endif
}}}

"	defect	closed	minor		other	1.8.x	fixed				"nginx version: nginx/1.8.1
built with OpenSSL 1.0.2a 19 Mar 2015
TLS SNI support enabled
configure arguments:CMakeLists.txt"
