浏览代码

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

master
JustAnotherArchivist 1年前
父节点
当前提交
10c7ab0889
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      http-response-bodies.c

+ 1
- 1
http-response-bodies.c 查看文件

@@ -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);


正在加载...
取消
保存