Skip to content

Commit d90f856

Browse files
committed
- #51273, Content-length header is limited to 32bit integer with apache2/windows
1 parent 7de2607 commit d90f856

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sapi/apache2handler/sapi_apache2.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,15 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
120120
}
121121
ctx->content_type = estrdup(val);
122122
} else if (!strcasecmp(sapi_header->header, "content-length")) {
123-
ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10));
123+
#ifdef PHP_WINDOWS
124+
# ifdef APR_HAS_LARGE_FILES
125+
ap_set_content_length(ctx->r, (apr_off_t) _strtoui64(val, (char **)NULL, 10));
126+
# else
127+
ap_set_content_length(ctx->r, (apr_off_t) strtol(val, (char **)NULL, 10));
128+
# endif
129+
#else
130+
ap_set_content_length(ctx->r, (apr_off_t) strtol(val, (char **)NULL, 10));
131+
#endif
124132
} else if (op == SAPI_HEADER_REPLACE) {
125133
apr_table_set(ctx->r->headers_out, sapi_header->header, val);
126134
} else {

0 commit comments

Comments
 (0)