commit | 16315761dbbc864511355d3478ba48a50b4d698a | [log] [tgz] |
---|---|---|
author | Igor Sysoev <igor@sysoev.ru> | Thu Jan 24 15:18:58 2008 +0000 |
committer | Igor Sysoev <igor@sysoev.ru> | Thu Jan 24 15:18:58 2008 +0000 |
tree | c735a46bdb775e8fabba885f1e0f37d64cd0fe02 | |
parent | fb42465646d323095ba9cc233d46e5dd5771874e [diff] [blame] |
limit string length
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c index 11f1cf2..acd9382 100644 --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c
@@ -227,7 +227,9 @@ } } else { - buf = ngx_cpymem(buf, p, slen); + len = (buf + slen < last) ? slen : (size_t) (last - buf); + + buf = ngx_cpymem(buf, p, len); } fmt++;