mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@105005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -787,12 +787,8 @@ void ast_cdr_setapp(struct ast_cdr *cdr, char *app, char *data)
|
||||
for (; cdr; cdr = cdr->next) {
|
||||
if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
|
||||
check_post(cdr);
|
||||
if (!app)
|
||||
app = "";
|
||||
ast_copy_string(cdr->lastapp, app, sizeof(cdr->lastapp));
|
||||
if (!data)
|
||||
data = "";
|
||||
ast_copy_string(cdr->lastdata, data, sizeof(cdr->lastdata));
|
||||
ast_copy_string(cdr->lastapp, S_OR(app, ""), sizeof(cdr->lastapp));
|
||||
ast_copy_string(cdr->lastdata, S_OR(data, ""), sizeof(cdr->lastdata));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user