Skip to content

Commit

Permalink
Fixes #177: NULL pointer dereference in FindServiceControlURLPath
Browse files Browse the repository at this point in the history
Also fixes its dual bug in FindServiceEventURLPath.
  • Loading branch information
mrjimenez committed Jun 4, 2020
1 parent ef04e55 commit c805c1d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,12 @@
Version 1.12.2
*******************************************************************************

2020-06-04 Patrik Lantz pjlantz(at)github

Fixes #177

NULL pointer dereference in FindServiceControlURLPath

*******************************************************************************
Version 1.12.1
*******************************************************************************
Expand Down
16 changes: 10 additions & 6 deletions upnp/src/genlib/service_table/service_table.c
Expand Up @@ -282,9 +282,11 @@ service_info *FindServiceEventURLPath(
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) {
if (finger->eventURL) {
Expand Down Expand Up @@ -327,9 +329,11 @@ service_info *FindServiceControlURLPath(
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) {
Expand Down

0 comments on commit c805c1d

Please sign in to comment.