Fix for crash in webserver.c by Sebastian Brandt
Dear libupnp-devels, when POST'ing to the simple web server in libupnp, the application crashes. This is caused by a missing "..." argument in webserver.c:1533. Seems it has been there for a long time ... 1.6.9 and 1.6.18 have it. webserver.c:1533 calls http_MakeMessage /* Send response. */ http_MakeMessage(&headers, 1, 1, "RTLSXcCc", ret, "text/html", X_USER_AGENT); The format parameter RTLSXcCc needs four arguments - R - response code - ret, T- content type - text/html, L - struct SendInstruction * - NOT PRESENT X - user agent - X_USER_AGENT This results in a crash. Changing to http_MakeMessage(&headers, 1, 1, "RTLSXcCc", ret, "text/html", &RespInstr, X_USER_AGENT); solves the situation. Yours, Sebastian Brandt
This commit is contained in:
committed by
Marcelo Roberto Jimenez
parent
dcbbc30f5c
commit
25c27b8af7
@@ -1531,7 +1531,7 @@ void web_server_callback(http_parser_t *parser, INOUT http_message_t *req,
|
||||
/* Send response. */
|
||||
http_MakeMessage(&headers, 1, 1,
|
||||
"RTLSXcCc",
|
||||
ret, "text/html", X_USER_AGENT);
|
||||
ret, "text/html", &RespInstr, X_USER_AGENT);
|
||||
http_SendMessage(info, &timeout, "b",
|
||||
headers.buf, headers.length);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user