diff options
-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 */ |