[Asterisk-code-review] res pjsip: Fix infinite recursion when loading transports f... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Mon Feb 8 17:01:39 CST 2016


Richard Mudgett has posted comments on this change.

Change subject: res_pjsip:  Fix infinite recursion when loading transports from realtime
......................................................................


Patch Set 10:

(2 comments)

https://gerrit.asterisk.org/#/c/2129/10/res/res_pjsip/config_transport.c
File res/res_pjsip/config_transport.c:

Line 250: 		key = ast_alloca(MAX_POINTER_STRING);
        : 		if (!key) {
        : 			return NULL;
        : 		}
FYI: ast_alloca() effectively can never fail since it is allocating from the program stack.  If there isn't any more stack space you have just blown the stack and can expect to crash if you use the returned memory.


Line 291: 	internal_state->state = ao2_alloc(sizeof(*internal_state->state), sip_transport_state_destroy);
        : 	if (!internal_state->state) {
        : 		ao2_cleanup(internal_state);
        : 		return NULL;
        : 	}
        : 	internal_state->state->id = ast_strdup(internal_state->id);
        : 	internal_state->state->type = transport->type;
        : 
        : 	pjsip_tls_setting_default(&internal_state->state->tls);
        : 	internal_state->state->tls.ciphers = internal_state->state->ciphers;
> I don't think line 300 is going to do anything productive. internal_state->
@mmichelson: I don't think using memset is that good an idea here in case the ciphers ever get initialized to something non-zero.


-- 
To view, visit https://gerrit.asterisk.org/2129
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic7a836ea8e786e8def51fe3f8cce855ea54f5f19
Gerrit-PatchSet: 10
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list