소스 검색

Minor change to civetweb.c

When reporting an error if parse_http_message were to fail, sending back user input as is to the client poses a security risk to browsers. I propose removing the string in the error reporting.
kalphamon 10 년 전
부모
커밋
aba522b352
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -8803,7 +8803,7 @@ getreq(struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
 	} else if (parse_http_message(
 	               conn->buf, conn->buf_size, &conn->request_info) <= 0) {
 		snprintf(
-		    ebuf, ebuf_len, "Bad request: [%.*s]", conn->data_len, conn->buf);
+		    ebuf, ebuf_len, "Bad request: [len=%d]", conn->data_len);
 		*err = 400;
 		return 0;
 	} else {