diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-28 19:20:10 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-28 19:20:10 +0000 |
commit | a166a1242cd1f6e9f17f965853d07097a59aab68 (patch) | |
tree | a7f02e6efa00b35ba4ce414ded15cc8322a20204 /main/pbx.c | |
parent | dfe3905779e35a7c1d7c4fb41703088e8cca4b0c (diff) |
Make pbx_exec pass an empty string into applications, if we get NULL.
This protects against possible segfaults in applications that may try
to use data before checking length (ast_strdupa'ing it, for example)
(closes issue #12100)
Reported by: foxfire
Patches:
12100-nullappargs.diff uploaded by qwell (license 4)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105005 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index e1a2d2e87..05e3b2d45 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -516,7 +516,7 @@ int pbx_exec(struct ast_channel *c, /*!< Channel */ const char *saved_c_appl; const char *saved_c_data; - if (c->cdr && !ast_check_hangup(c)) + if (c->cdr && !ast_check_hangup(c)) ast_cdr_setapp(c->cdr, app->name, data); /* save channel values */ @@ -529,7 +529,7 @@ int pbx_exec(struct ast_channel *c, /*!< Channel */ if (app->module) { /* XXX LOCAL_USER_ADD(app->module) */ } - res = app->execute(c, data); + res = app->execute(c, S_OR(data, "")); if (app->module) { /* XXX LOCAL_USER_REMOVE(app->module) */ } |