[Asterisk-code-review] rtp engine: Prevent possible double free with DTLS config (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Fri Sep 1 16:55:31 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/6380 )

Change subject: rtp_engine: Prevent possible double free with DTLS config
......................................................................


Patch Set 1:

(2 comments)

Patch will work as is.  -1 just so comments are noticed.

https://gerrit.asterisk.org/#/c/6380/1/main/rtp_engine.c
File main/rtp_engine.c:

https://gerrit.asterisk.org/#/c/6380/1/main/rtp_engine.c@2114
PS1, Line 2114: 		release_cfg_string(&dtls_cfg->certfile);
              : 		if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {
              : 			ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);
              : 			return -1;
              : 		}
It would be just as effective and simpler to move the ast_free() to after the validation check.  If the new value is invalid then you still have the old value in place as a fallback.


https://gerrit.asterisk.org/#/c/6380/1/main/rtp_engine.c@2128
PS1, Line 2128: 		release_cfg_string(&dtls_cfg->cipher);
This change isn't really necessary.



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I097b81734ef730f8603c0b972909d212a3a5cf89
Gerrit-Change-Number: 6380
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 01 Sep 2017 21:55:31 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170901/f517cae0/attachment.html>


More information about the asterisk-code-review mailing list