]> git.kaiwu.me - nginx.git/commit
Memcached: protect from too long responses.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Jul 2020 15:36:17 +0000 (18:36 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Jul 2020 15:36:17 +0000 (18:36 +0300)
commitb835b571846abb13b995498e7ee36fe0f4aaa3bf
tree2d879f656fc2667938d7fa2cc7058c45ea7c994c
parent829c9d5981da1abc81dd7e2fb563da592203e54a
Memcached: protect from too long responses.

If a memcached response was followed by a correct trailer, and then
the NUL character followed by some extra data - this was accepted by
the trailer checking code.  This in turn resulted in ctx->rest underflow
and caused negative size buffer on the next reading from the upstream,
followed by the "negative size buf in writer" alert.

Fix is to always check for too long responses, so a correct trailer cannot
be followed by extra data.
src/http/modules/ngx_http_memcached_module.c