aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-23 21:06:40 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-23 21:06:40 +0000
commit7b5241d709169079b0e25a876c0e3dc52a2b61ee (patch)
tree420b6c5eb99ef22cb101de502b353ea19a95a478 /res
parentec319c0f70ea3e3a5a9205afb5f40f6e7c3cadf2 (diff)
Ensure a NULL file while debugging cannot crash AEL.
(closes issue #17215) Reported by: vazir Patches: 20100518__issue17215.diff.txt uploaded by tilghman (license 14) Tested by: tilghman git-svn-id: http://svn.digium.com/svn/asterisk/trunk@272260 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/ael/ael.flex2
-rw-r--r--res/ael/ael.tab.c2
-rw-r--r--res/ael/ael.y2
-rw-r--r--res/ael/ael_lex.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/res/ael/ael.flex b/res/ael/ael.flex
index 0674ba8ff..4d441fb73 100644
--- a/res/ael/ael.flex
+++ b/res/ael/ael.flex
@@ -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)
diff --git a/res/ael/ael.tab.c b/res/ael/ael.tab.c
index cbe9d8c33..4d44d44f3 100644
--- a/res/ael/ael.tab.c
+++ b/res/ael/ael.tab.c
@@ -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;
}
diff --git a/res/ael/ael.y b/res/ael/ael.y
index c8bc9c78e..27e04c583 100644
--- a/res/ael/ael.y
+++ b/res/ael/ael.y
@@ -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;
}
diff --git a/res/ael/ael_lex.c b/res/ael/ael_lex.c
index 6517644bd..02d8f82e4 100644
--- a/res/ael/ael_lex.c
+++ b/res/ael/ael_lex.c
@@ -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)