]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 206868 via svnmerge from
authorDavid Vossel <dvossel@digium.com>
Thu, 16 Jul 2009 21:27:17 +0000 (21:27 +0000)
committerDavid Vossel <dvossel@digium.com>
Thu, 16 Jul 2009 21:27:17 +0000 (21:27 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r206868 | dvossel | 2009-07-16 16:25:22 -0500 (Thu, 16 Jul 2009) | 14 lines

  Merged revisions 206867 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r206867 | dvossel | 2009-07-16 16:24:16 -0500 (Thu, 16 Jul 2009) | 8 lines

    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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@206870 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/callerid.c

index 6bb5c95bfd24166fd2a95b7df7226de137f670a1..d87eacb1219a02c7af788ebe4bd4a9d9e317f42f 100644 (file)
@@ -1128,6 +1128,9 @@ static struct {
 int ast_parse_caller_presentation(const char *data)
 {
        int i;
+       if (!data) {
+               return -1;
+       }
 
        for (i = 0; i < ARRAY_LEN(pres_types); i++) {
                if (!strcasecmp(pres_types[i].name, data))