]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure a NULL file while debugging cannot crash AEL.
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 23 Jun 2010 21:06:40 +0000 (21:06 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 23 Jun 2010 21:06:40 +0000 (21:06 +0000)
(closes issue #17215)
 Reported by: vazir
 Patches:
       20100518__issue17215.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272260 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/ael/ael.flex
res/ael/ael.tab.c
res/ael/ael.y
res/ael/ael_lex.c

index 0674ba8ff16407d835b160ce6fabc989ab3a1c68..4d441fb73bd9525ce499c80ce4e942048782f60f 100644 (file)
@@ -887,7 +887,7 @@ static void setup_filestack(char *fnamebuf2, int fnamebuf_siz, glob_t *globbuf,
                                free(include_stack[include_stack_index].fname);
                                include_stack[include_stack_index].fname = 0;
                        }
-                       include_stack[include_stack_index].fname = strdup(my_file);
+                       include_stack[include_stack_index].fname = strdup(S_OR(my_file, "<none>"));
                        include_stack[include_stack_index].lineno = my_lineno;
                        include_stack[include_stack_index].colno = my_col+yyleng;
                        if (my_file)
index cbe9d8c337a471cf3b2af49407e866bf4f6a167f..4d44d44f3a17a5e08b675f0a0d76d6ee1968e3f7 100644 (file)
@@ -3470,7 +3470,7 @@ struct pval *npval(pvaltype type, int first_line, int last_line,
        z->endline = last_line;
        z->startcol = first_column;
        z->endcol = last_column;
-       z->filename = strdup(my_file);
+       z->filename = strdup(S_OR(my_file, "<none>"));
        return z;
 }
 
index c8bc9c78ebfa6d119db89a2c539adaaa347e0c5e..27e04c583417870621ddfd4bf5b259103cc37f9a 100644 (file)
@@ -854,7 +854,7 @@ struct pval *npval(pvaltype type, int first_line, int last_line,
        z->endline = last_line;
        z->startcol = first_column;
        z->endcol = last_column;
-       z->filename = strdup(my_file);
+       z->filename = strdup(S_OR(my_file, "<none>"));
        return z;
 }
 
index 6517644bde7a6f399c1ac7daa5445e48454c0596..02d8f82e49f349e0e0a31c2ef4cb025d776173ed 100644 (file)
@@ -3444,7 +3444,7 @@ static void setup_filestack(char *fnamebuf2, int fnamebuf_siz, glob_t *globbuf,
                                free(include_stack[include_stack_index].fname);
                                include_stack[include_stack_index].fname = 0;
                        }
-                       include_stack[include_stack_index].fname = strdup(my_file);
+                       include_stack[include_stack_index].fname = strdup(S_OR(my_file, "<none>"));
                        include_stack[include_stack_index].lineno = my_lineno;
                        include_stack[include_stack_index].colno = my_col+yyleng;
                        if (my_file)