Pārlūkot izejas kodu

Fix off-by-one error for non-chunked responses

master
JustAnotherArchivist pirms 1 gada
vecāks
revīzija
10c7ab0889
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. +1
    -1
      http-response-bodies.c

+ 1
- 1
http-response-bodies.c Parādīt failu

@@ -205,7 +205,7 @@ checkstate:
return 1;
}
} else if (state == STATE_BODY || state == STATE_CHUNK_CONTENTS) {
if (length + 2 - bytes_read > n) {
if (length + (state == STATE_BODY ? 1 : 2) - bytes_read > n) {
// Only got part of the body
DEBUG_PRINTF("Partial body\n");
DEBUG_PRINTF("Copying %zu bytes to stdout\n", n);


Notiek ielāde…
Atcelt
Saglabāt