1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-18 08:15:14 +00:00

Return 400 when find blank line after boundary (#456)

This commit is contained in:
Xiangyue Cai
2021-03-11 16:24:32 +08:00
committed by GitHub
parent 3a3c29e963
commit 993d464cda

View File

@@ -2177,6 +2177,11 @@ upload_read_cb (evhtp_request_t *req, evbuf_t *buf, void *arg)
if (len == 0) {
/* Read an blank line, headers end. */
free (line);
// Each part MUST contain a Content-Disposition header field
if (!fsm->input_name) {
res = EVHTP_RES_BADREQ;
goto out;
}
if (g_strcmp0 (fsm->input_name, "file") == 0) {
if (open_temp_file (fsm) < 0) {
seaf_warning ("[upload] Failed open temp file, errno:[%d]\n", errno);