[asterisk-commits] CHAOS: prevent sorcery object with null id (asterisk[13])
    SVN commits to the Asterisk project 
    asterisk-commits at lists.digium.com
       
    Mon Aug 17 15:41:18 CDT 2015
    
    
  
Mark Michelson has submitted this change and it was merged.
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(-)
Approvals:
  Mark Michelson: Looks good to me, approved
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
diff --git a/main/sorcery.c b/main/sorcery.c
index 2f45196..43a395a 100644
--- a/main/sorcery.c
+++ b/main/sorcery.c
@@ -1736,6 +1736,10 @@
 	} else {
 		details->object->id = ast_strdup(id);
 	}
+	if (!details->object->id) {
+		ao2_ref(details, -1);
+		return NULL;
+	}
 
 	ast_copy_string(details->object->type, type, sizeof(details->object->type));
 
-- 
To view, visit https://gerrit.asterisk.org/1101
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I152133fb7545a4efcf7a0080ada77332d038669e
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
    
    
More information about the asterisk-commits
mailing list