diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2011-09-19 21:11:16 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2011-11-09 20:10:03 +0100 |
commit | beaa342af6966a6acb7780644ff6285c85d5f641 (patch) | |
tree | 0a21bd4af48b973c88879a490fa1fd1344242144 | |
parent | b0c03a60fa6438f10e8cf74cac482243a7938990 (diff) | |
download | pianobar-beaa342af6966a6acb7780644ff6285c85d5f641.tar.gz pianobar-beaa342af6966a6acb7780644ff6285c85d5f641.tar.bz2 pianobar-beaa342af6966a6acb7780644ff6285c85d5f641.zip |
waitress: muke sure chunked handler reads \r\n
-rw-r--r-- | src/libwaitress/waitress.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c index 2101e2a..5e3fd41 100644 --- a/src/libwaitress/waitress.c +++ b/src/libwaitress/waitress.c @@ -539,8 +539,12 @@ static WaitressHandlerReturn_t WaitressHandleChunked (WaitressHandle_t *waith, waith->request.chunkSize) == WAITRESS_HANDLER_ABORTED) { return WAITRESS_HANDLER_ABORTED; } - /* FIXME: skip trailing \r\n */ - content += waith->request.chunkSize+2; + content += waith->request.chunkSize; + if (content[0] == '\r' && content[1] == '\n') { + content += 2; + } else { + return WAITRESS_HANDLER_ERR; + } waith->request.chunkSize = 0; } else { if (WaitressHandleIdentity (waith, content, remaining) == |