[Asterisk-code-review] CHAOS: prevent sorcery object with null id (asterisk[13])

Scott Griepentrog asteriskteam at digium.com
Mon Aug 17 11:05:26 CDT 2015


Scott Griepentrog has uploaded a new change for review.

  https://gerrit.asterisk.org/1101

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/01/1101/1

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: newchange
Gerrit-Change-Id: I152133fb7545a4efcf7a0080ada77332d038669e
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-code-review mailing list