mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 17:41:53 +00:00
don't deref NULL. Found by Klockwork (www.klocwork.com)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8516 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
91fc355a62
commit
9b2b3beed2
@ -419,14 +419,17 @@ abyss_bool handler_hook(TSession * r)
|
|||||||
stream.write_function = http_stream_write;
|
stream.write_function = http_stream_write;
|
||||||
stream.raw_write_function = http_stream_raw_write;
|
stream.raw_write_function = http_stream_raw_write;
|
||||||
|
|
||||||
|
if (!r || !r->uri) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if ((command = strstr(r->uri, "/api/"))) {
|
if ((command = strstr(r->uri, "/api/"))) {
|
||||||
command += 5;
|
command += 5;
|
||||||
} else if ((command = strstr(r->uri, "/webapi/"))) {
|
} else if ((command = strstr(r->uri, "/webapi/"))) {
|
||||||
command += 8;
|
command += 8;
|
||||||
html++;
|
html++;
|
||||||
} else {
|
} else {
|
||||||
ret = FALSE;
|
return FALSE;
|
||||||
goto end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((path_info = strchr(command, '/'))) {
|
if ((path_info = strchr(command, '/'))) {
|
||||||
@ -490,7 +493,6 @@ abyss_bool handler_hook(TSession * r)
|
|||||||
switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "FreeSWITCH-Domain", "%s", fs_domain);
|
switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "FreeSWITCH-Domain", "%s", fs_domain);
|
||||||
if (path_info)
|
if (path_info)
|
||||||
switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-Path-Info", "%s", path_info);
|
switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-Path-Info", "%s", path_info);
|
||||||
if (r->uri)
|
|
||||||
switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-URI", "%s", r->uri);
|
switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-URI", "%s", r->uri);
|
||||||
if (r->query)
|
if (r->query)
|
||||||
switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-QUERY", "%s", r->query);
|
switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-QUERY", "%s", r->query);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user