diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-08-04 10:42:06 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-08-04 10:42:06 +0200 |
commit | 542c4c17be349fc97fef2a06fb68b0a41cf2a033 (patch) | |
tree | e061f7597f8d9f6498a4aede8c4496e5351a7549 /libwaitress/src/main.c | |
parent | e64da9453e3a3466f419dc07381135d893e507ff (diff) | |
download | pianobar-542c4c17be349fc97fef2a06fb68b0a41cf2a033.tar.gz pianobar-542c4c17be349fc97fef2a06fb68b0a41cf2a033.tar.bz2 pianobar-542c4c17be349fc97fef2a06fb68b0a41cf2a033.zip |
waitress: Ensure buffer is always null-terminated
Diffstat (limited to 'libwaitress/src/main.c')
-rw-r--r-- | libwaitress/src/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libwaitress/src/main.c b/libwaitress/src/main.c index c09f9de..ab326cd 100644 --- a/libwaitress/src/main.c +++ b/libwaitress/src/main.c @@ -376,8 +376,9 @@ WaitressReturn_t WaitressFetchCall (WaitressHandle_t *waith) { /* receive answer */ nextLine = recvBuf; while (hdrParseMode != HDRM_FINISHED) { - READ_RET (recvBuf+bufFilled, sizeof (recvBuf) - bufFilled, &recvSize); + READ_RET (recvBuf+bufFilled, sizeof (recvBuf)-1 - bufFilled, &recvSize); bufFilled += recvSize; + memset (recvBuf+bufFilled, 0, sizeof (recvBuf) - bufFilled); thisLine = recvBuf; /* split */ |