[asterisk-commits] kharwell: branch certified-13.1 r431700 - in /certified/branches/13.1: ./ res...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Feb 11 12:04:12 CST 2015
Author: kharwell
Date: Wed Feb 11 12:04:09 2015
New Revision: 431700
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=431700
Log:
res_pjsip: dtls_handler causes Asterisk to crash
There have been a couple of times where a crash occurred in the dtls_handler
section of the code for res_pjsip. Unfortunately, in working this issue the
problem was unable to be reproduced. After looking at the backtraces and
through the code the current best guess as to why this happened might be due
to a reentrance problem and the strtok function. So, the current fix is to
convert the strtok function into the reentrant version of the function,
strtok_r.
ASTERISK-24741 #close
Reported by: Zane Conkle
Review: https://reviewboard.asterisk.org/r/4409/
........
Merged revisions 431698 from http://svn.asterisk.org/svn/asterisk/branches/13
Modified:
certified/branches/13.1/ (props changed)
certified/branches/13.1/res/res_pjsip/pjsip_configuration.c
Propchange: certified/branches/13.1/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.
Modified: certified/branches/13.1/res/res_pjsip/pjsip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/13.1/res/res_pjsip/pjsip_configuration.c?view=diff&rev=431700&r1=431699&r2=431700
==============================================================================
--- certified/branches/13.1/res/res_pjsip/pjsip_configuration.c (original)
+++ certified/branches/13.1/res/res_pjsip/pjsip_configuration.c Wed Feb 11 12:04:09 2015
@@ -646,15 +646,15 @@
{
struct ast_sip_endpoint *endpoint = obj;
char *name = ast_strdupa(var->name);
- char *front, *buf = name;
+ char *front, *back, *buf = name;
/* strip out underscores in the name */
- front = strtok(buf, "_");
+ front = strtok_r(buf, "_", &back);
while (front) {
int size = strlen(front);
ast_copy_string(buf, front, size + 1);
buf += size;
- front = strtok(NULL, "_");
+ front = strtok_r(NULL, "_", &back);
}
return ast_rtp_dtls_cfg_parse(&endpoint->media.rtp.dtls_cfg, name, var->value);
More information about the asterisk-commits
mailing list