summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 231f376a8..3d52ce4b8 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -22232,7 +22232,12 @@ static int func_header_read(struct ast_channel *chan, const char *function, char
);
int i, number, start = 0;
- if (ast_strlen_zero(data)) {
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", function);
+ return -1;
+ }
+
+ if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "This function requires a header name.\n");
return -1;
}
@@ -22418,7 +22423,12 @@ static int function_sipchaninfo_read(struct ast_channel *chan, const char *cmd,
*buf = 0;
- if (!data) {
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
+ if (!data) {
ast_log(LOG_WARNING, "This function requires a parameter name.\n");
return -1;
}