diff --git a/apps/app_read.c b/apps/app_read.c index 977b20dc29..f4a965c8b4 100644 --- a/apps/app_read.c +++ b/apps/app_read.c @@ -250,7 +250,7 @@ static int read_exec(struct ast_channel *chan, const char *data) break; } tmp[x++] = res; - if (strchr(terminator, tmp[x-1])) { + if (terminator && strchr(terminator, tmp[x-1])) { tmp[x-1] = '\0'; status = "OK"; break; diff --git a/main/app.c b/main/app.c index f5fbffd7f7..411d5077b0 100644 --- a/main/app.c +++ b/main/app.c @@ -249,7 +249,7 @@ enum ast_getdata_result ast_app_getdata_terminator(struct ast_channel *c, const fto = 50; to = ast_channel_pbx(c) ? ast_channel_pbx(c)->dtimeoutms : 2000; } - res = ast_readstring(c, s, maxlen, to, fto, S_OR(terminator, "#")); + res = ast_readstring(c, s, maxlen, to, fto, (terminator ? terminator : "#")); if (res == AST_GETDATA_EMPTY_END_TERMINATED) { return res; }