From d22c6cf5878d8919cd7eb612269555c6fa0c296a Mon Sep 17 00:00:00 2001 From: lvhan Date: Mon, 1 Feb 2021 10:47:36 +0800 Subject: [PATCH] CVE-2020-13848 --- upnp/src/genlib/service_table/service_table.c | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/upnp/src/genlib/service_table/service_table.c b/upnp/src/genlib/service_table/service_table.c index 98c2c0f..b74fd1c 100644 --- a/upnp/src/genlib/service_table/service_table.c +++ b/upnp/src/genlib/service_table/service_table.c @@ -300,11 +300,11 @@ FindServiceEventURLPath( service_table * table, uri_type parsed_url; uri_type parsed_url_in; - if( ( table ) - && - ( parse_uri( eventURLPath, - strlen( eventURLPath ), - &parsed_url_in ) == HTTP_SUCCESS ) ) { + if (!table || !eventURLPath) { + return NULL; + } + if (parse_uri(eventURLPath, strlen(eventURLPath), &parsed_url_in) == + HTTP_SUCCESS) { finger = table->serviceList; while( finger ) { @@ -352,11 +352,12 @@ FindServiceControlURLPath( service_table * table, uri_type parsed_url; uri_type parsed_url_in; - if( ( table ) - && - ( parse_uri - ( controlURLPath, strlen( controlURLPath ), - &parsed_url_in ) == HTTP_SUCCESS ) ) { + if (!table || !controlURLPath) { + return NULL; + } + if (parse_uri(controlURLPath, strlen(controlURLPath), &parsed_url_in) == + HTTP_SUCCESS) { + finger = table->serviceList; while( finger ) { if( finger->controlURL ) -- 2.29.2.windows.2