diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-16 21:24:16 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-16 21:24:16 +0000 |
commit | e3ff7d732fdb7538480bb2628c3926b0dedaaf80 (patch) | |
tree | 803e1efb7332465398a97958081977d54b8b51f0 /main | |
parent | f6fce41ffcf0c6a93d97208f2a9a7c3fd3575b50 (diff) |
avoid segfault caused by user error
If the CALLERPRES() dialplan function is set to nothing,
a segfault occurs. This is user error to begin with, but
I'd rather see a cli warning message than have Asterisk
crash on me.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@206867 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/callerid.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/callerid.c b/main/callerid.c index cd6cde116..edc00a5e5 100644 --- a/main/callerid.c +++ b/main/callerid.c @@ -1092,6 +1092,10 @@ int ast_parse_caller_presentation(const char *data) { int i; + if (!data) { + return -1; + } + for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) { if (!strcasecmp(pres_types[i].name, data)) return pres_types[i].val; |