summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-08-04 10:42:06 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-08-04 10:42:06 +0200
commit542c4c17be349fc97fef2a06fb68b0a41cf2a033 (patch)
treee061f7597f8d9f6498a4aede8c4496e5351a7549
parente64da9453e3a3466f419dc07381135d893e507ff (diff)
downloadpianobar-542c4c17be349fc97fef2a06fb68b0a41cf2a033.tar.gz
pianobar-542c4c17be349fc97fef2a06fb68b0a41cf2a033.tar.bz2
pianobar-542c4c17be349fc97fef2a06fb68b0a41cf2a033.zip
waitress: Ensure buffer is always null-terminated
-rw-r--r--libwaitress/src/main.c3
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 */