Commit 395dad08 authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

using len to avoid problems on non null termidated strings

parent 63242edc
...@@ -1273,7 +1273,7 @@ ngx_http_push_stream_get_formatted_chunk(const u_char *text, off_t len, ngx_pool ...@@ -1273,7 +1273,7 @@ ngx_http_push_stream_get_formatted_chunk(const u_char *text, off_t len, ngx_pool
/* the "0000000000000000" is 64-bit hexadimal string */ /* the "0000000000000000" is 64-bit hexadimal string */
chunk = ngx_http_push_stream_create_str(temp_pool, sizeof("0000000000000000" CRLF CRLF CRLF) + len); chunk = ngx_http_push_stream_create_str(temp_pool, sizeof("0000000000000000" CRLF CRLF CRLF) + len);
if (chunk != NULL) { if (chunk != NULL) {
ngx_sprintf(chunk->data, "%xO" CRLF "%s" CRLF CRLF, len + sizeof(CRLF) - 1, text); ngx_sprintf(chunk->data, "%xO" CRLF "%*s" CRLF CRLF, len + sizeof(CRLF) - 1, len, text);
chunk->len = ngx_strlen(chunk->data); chunk->len = ngx_strlen(chunk->data);
} }
return chunk; return chunk;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment