Respect unique_service_name error in ssdp_request_type.

Respect unique_service_name error in ssdp_request_type
so as not to touch non-terminated buffer under Evt.
(cherry picked from commit 5944960e172a797a9fcc196291f4046cafa7f6ec)
This commit is contained in:
Yoichi NAKAYAMA 2012-03-11 03:52:37 +09:00 committed by Marcelo Roberto Jimenez
parent 9223094468
commit c9024bbb40
2 changed files with 6 additions and 1 deletions

View File

@ -328,6 +328,8 @@ Version 1.6.16
* Pass output buffer size to addrToString and detect overflow. * Pass output buffer size to addrToString and detect overflow.
* Handle addrToString error in configure_urlbase. * Handle addrToString error in configure_urlbase.
* Handle overflow in http_SendMessage. * Handle overflow in http_SendMessage.
* Respect unique_service_name error in ssdp_request_type
so as not to touch non-terminated buffer under Evt.
* Treat large argument as error in UpnpAddVirtualDir. * Treat large argument as error in UpnpAddVirtualDir.
* Do not clear buffer before snprintf. * Do not clear buffer before snprintf.
* Clarify the last argument of GetDescDocumentAndURL has size LINE_SIZE. * Clarify the last argument of GetDescDocumentAndURL has size LINE_SIZE.

View File

@ -552,7 +552,10 @@ int ssdp_request_type(char *cmd, SsdpEvent *Evt)
{ {
/* clear event */ /* clear event */
memset(Evt, 0, sizeof(SsdpEvent)); memset(Evt, 0, sizeof(SsdpEvent));
unique_service_name(cmd, Evt); if (unique_service_name(cmd, Evt) != 0) {
Evt->ErrCode = E_HTTP_SYNTEX;
return -1;
}
Evt->ErrCode = NO_ERROR_FOUND; Evt->ErrCode = NO_ERROR_FOUND;
if ((Evt->RequestType = ssdp_request_type1(cmd)) == SSDP_SERROR) { if ((Evt->RequestType = ssdp_request_type1(cmd)) == SSDP_SERROR) {
Evt->ErrCode = E_HTTP_SYNTEX; Evt->ErrCode = E_HTTP_SYNTEX;