projects
/
asterisk/asterisk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a85711
)
CHAOS: prevent sorcery object with null id
author
Scott Griepentrog
<scott@griepentrog.com>
Mon, 17 Aug 2015 16:00:53 +0000
(11:00 -0500)
committer
Scott Griepentrog
<scott@griepentrog.com>
Mon, 17 Aug 2015 16:03:06 +0000
(11:03 -0500)
When allocating a sorcery object, fail if the
id value was not allocated.
ASTERISK-25323
Reported by: Scott Griepentrog
Change-Id: I152133fb7545a4efcf7a0080ada77332d038669e
main/sorcery.c
patch
|
blob
|
history
diff --git
a/main/sorcery.c
b/main/sorcery.c
index
6d24b14
..
f9f7c38
100644
(file)
--- a/
main/sorcery.c
+++ b/
main/sorcery.c
@@
-1739,6
+1739,10
@@
void *ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, con
} else {
details->object->id = ast_strdup(id);
}
+ if (!details->object->id) {
+ ao2_ref(details, -1);
+ return NULL;
+ }
details->object->created = ast_tvnow();
ast_copy_string(details->object->type, type, sizeof(details->object->type));