mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-16 09:52:24 +00:00
app_adsiprog: Fix possible NULL dereference.
get_token can return NULL, but process_token uses this result without checking for NULL; as elsewhere, check for a NULL result to avoid possible NULL dereference. Resolves: #1419
This commit is contained in:
committed by
github-actions[bot]
parent
170048a41e
commit
4aad564b93
@@ -848,7 +848,10 @@ static int onevent(char *buf, char *name, int id, char *args, struct adsi_script
|
||||
return 0;
|
||||
}
|
||||
/* Process 'in' things */
|
||||
tok = get_token(&args, script, lineno);
|
||||
if (!(tok = get_token(&args, script, lineno))) {
|
||||
ast_log(LOG_WARNING, "Missing state name at line %d of %s\n", lineno, script);
|
||||
return 0;
|
||||
}
|
||||
if (process_token(sname, tok, sizeof(sname), ARG_STRING)) {
|
||||
ast_log(LOG_WARNING, "'%s' is not a valid state name at line %d of %s\n", tok, lineno, script);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user