mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
FSCORE-297
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12173 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -643,7 +643,7 @@ ESL_DECLARE(esl_status_t) esl_connect(esl_handle_t *handle, const char *host, es
|
||||
|
||||
hval = esl_event_get_header(handle->last_event, "content-type");
|
||||
|
||||
if (strcasecmp(hval, "auth/request")) {
|
||||
if (esl_safe_strcasecmp(hval, "auth/request")) {
|
||||
snprintf(handle->err, sizeof(handle->err), "Connection Error");
|
||||
goto fail;
|
||||
}
|
||||
@@ -660,7 +660,7 @@ ESL_DECLARE(esl_status_t) esl_connect(esl_handle_t *handle, const char *host, es
|
||||
|
||||
hval = esl_event_get_header(handle->last_event, "reply-text");
|
||||
|
||||
if (strcasecmp(hval, "+OK accepted")) {
|
||||
if (esl_safe_strcasecmp(hval, "+OK accepted")) {
|
||||
snprintf(handle->err, sizeof(handle->err), "Authentication Error");
|
||||
goto fail;
|
||||
}
|
||||
@@ -876,7 +876,7 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, esl_event_t **sav
|
||||
|
||||
hval = esl_event_get_header(revent, "content-type");
|
||||
|
||||
if (!esl_strlen_zero(hval) && !strcasecmp(hval, "text/event-plain") && revent->body) {
|
||||
if (!esl_strlen_zero(hval) && !esl_safe_strcasecmp(hval, "text/event-plain") && revent->body) {
|
||||
const char *en;
|
||||
esl_event_types_t et = ESL_EVENT_COMMAND;
|
||||
char *body = strdup(revent->body);
|
||||
|
@@ -341,7 +341,7 @@ ESL_DECLARE(esl_status_t) esl_events(esl_handle_t *handle, esl_event_type_t etyp
|
||||
|
||||
#define esl_recv(_h) esl_recv_event(_h, NULL)
|
||||
#define esl_recv_timed(_h, _ms) esl_recv_event_timed(_h, _ms, NULL)
|
||||
|
||||
#define esl_safe_strcasecmp(_s1, _s2) ((_s1) && (_s2)) ? strcasecmp((_s1), (_s2)) : 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user