[Asterisk-code-review] CHAOS: prevent sorcery object with null id (asterisk[master])
Scott Griepentrog
asteriskteam at digium.com
Mon Aug 17 11:04:28 CDT 2015
Scott Griepentrog has uploaded a new change for review.
https://gerrit.asterisk.org/1100
Change subject: CHAOS: prevent sorcery object with null id
......................................................................
CHAOS: prevent sorcery object with null id
When allocating a sorcery object, fail if the
id value was not allocated.
ASTERISK-25323
Reported by: Scott Griepentrog
Change-Id: I152133fb7545a4efcf7a0080ada77332d038669e
---
M main/sorcery.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/00/1100/1
diff --git a/main/sorcery.c b/main/sorcery.c
index 6d24b14..f9f7c38 100644
--- a/main/sorcery.c
+++ b/main/sorcery.c
@@ -1739,6 +1739,10 @@
} 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));
--
To view, visit https://gerrit.asterisk.org/1100
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I152133fb7545a4efcf7a0080ada77332d038669e
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>
More information about the asterisk-code-review
mailing list