[asterisk-commits] branch group/autoconf_and_menuselect r18308 - in /team/group/autoconf_and_men...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 7 09:25:56 MST 2006


Author: russell
Date: Fri Apr  7 11:25:54 2006
New Revision: 18308

URL: http://svn.digium.com/view/asterisk?rev=18308&view=rev
Log:
more random missing files and changes

Added:
    team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name   (with props)
Modified:
    team/group/autoconf_and_menuselect/channels/chan_iax2.c
    team/group/autoconf_and_menuselect/channels/chan_sip.c

Added: team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name?rev=18308&view=auto
==============================================================================
--- team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name (added)
+++ team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name Fri Apr  7 11:25:54 2006
@@ -1,0 +1,50 @@
+#!/bin/sh
+
+PARTS=`LANG=C svn info | grep URL | awk '{print $2;}' | sed -e 's:^.*/svn/asterisk/::' | sed -e 's:/: :g'`
+BRANCH=0
+TEAM=0
+
+REV=`svnversion -c . | cut -d: -f2`
+
+if [ "${PARTS}" = "trunk" ]
+then
+    echo 'trunk'-r${REV}
+    exit 0
+fi
+
+for PART in $PARTS
+do
+  if [ ${BRANCH} != 0 ]
+  then
+      RESULT="${RESULT}-${PART}"
+      break
+  fi
+
+  if [ ${TEAM} != 0 ]
+  then
+      RESULT="${RESULT}-${PART}"
+      continue
+  fi
+
+  if [ "${PART}" = "branches" ]
+  then
+      BRANCH=1
+      RESULT="branch"
+      continue
+  fi
+
+  if [ "${PART}" = "tags" ]
+  then
+      BRANCH=1
+      RESULT="tag"
+      continue
+  fi
+
+  if [ "${PART}" = "team" ]
+  then
+      TEAM=1
+      continue
+  fi
+done
+
+echo ${RESULT##-}-r${REV}

Propchange: team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name
------------------------------------------------------------------------------
    svn:executable = *

Propchange: team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/autoconf_and_menuselect/build_tools/make_svn_branch_name
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/group/autoconf_and_menuselect/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/chan_iax2.c?rev=18308&r1=18307&r2=18308&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/chan_iax2.c (original)
+++ team/group/autoconf_and_menuselect/channels/chan_iax2.c Fri Apr  7 11:25:54 2006
@@ -2915,10 +2915,12 @@
 		char *key = NULL;
 
 		family = ast_strdupa(peer->dbsecret);
-		key = strchr(family, '/');
-		if (key)
-			*key++ = '\0';
-		if (!key || ast_db_get(family, key, cai->secret, sizeof(cai->secret))) {
+		if (family) {
+			key = strchr(family, '/');
+			if (key)
+				*key++ = '\0';
+		}
+		if (!family || !key || ast_db_get(family, key, cai->secret, sizeof(cai->secret))) {
 			ast_log(LOG_WARNING, "Unable to retrieve database password for family/key '%s'!\n", peer->dbsecret);
 			if (ast_test_flag(peer, IAX_TEMPONLY))
 				destroy_peer(peer);
@@ -4045,8 +4047,9 @@
 		unsigned char digest[16];
 		char *tmppw, *stringp;
 		
-		stringp = ast_strdupa(iaxs[callno]->secret);
-		while ((tmppw = strsep(&stringp, ";"))) {
+		tmppw = ast_strdupa(iaxs[callno]->secret);
+		stringp = tmppw;
+		while((tmppw = strsep(&stringp, ";"))) {
 			MD5Init(&md5);
 			MD5Update(&md5, (unsigned char *)iaxs[callno]->challenge, strlen(iaxs[callno]->challenge));
 			MD5Update(&md5, (unsigned char *)tmppw, strlen(tmppw));
@@ -5079,10 +5082,14 @@
 		if (!ast_strlen_zero(user->dbsecret)) {
 			char *family, *key=NULL;
 			family = ast_strdupa(user->dbsecret);
-			key = strchr(family, '/');
-			if (key)
-				*key++ = '\0';
-			if (!key || ast_db_get(family, key, iaxs[callno]->secret, sizeof(iaxs[callno]->secret))) {
+			if (family) {
+				key = strchr(family, '/');
+				if (key) {
+					*key = '\0';
+					key++;
+				}
+			}
+			if (!family || !key || ast_db_get(family, key, iaxs[callno]->secret, sizeof(iaxs[callno]->secret))) {
 				ast_log(LOG_WARNING, "Unable to retrieve database password for family/key '%s'!\n", user->dbsecret);
 				if (ast_test_flag(user, IAX_TEMPONLY)) {
 					destroy_user(user);
@@ -5188,8 +5195,9 @@
 		unsigned char digest[16];
 		char *tmppw, *stringp;
 		
-		stringp = ast_strdupa(p->secret);
-		while ((tmppw = strsep(&stringp, ";"))) {
+		tmppw = ast_strdupa(p->secret);
+		stringp = tmppw;
+		while((tmppw = strsep(&stringp, ";"))) {
 			MD5Init(&md5);
 			MD5Update(&md5, (unsigned char *)p->challenge, strlen(p->challenge));
 			MD5Update(&md5, (unsigned char *)tmppw, strlen(tmppw));
@@ -5324,8 +5332,9 @@
 		unsigned char digest[16];
 		char *tmppw, *stringp;
 		
-		stringp = ast_strdupa(p->secret);
-		while ((tmppw = strsep(&stringp, ";"))) {
+		tmppw = ast_strdupa(p->secret);
+		stringp = tmppw;
+		while((tmppw = strsep(&stringp, ";"))) {
 			MD5Init(&md5);
 			MD5Update(&md5, (unsigned char *)iaxs[callno]->challenge, strlen(iaxs[callno]->challenge));
 			MD5Update(&md5, (unsigned char *)tmppw, strlen(tmppw));
@@ -8727,7 +8736,7 @@
 				user->ha = ast_append_ha(v->name, v->value, user->ha);
 			} else if (!strcasecmp(v->name, "setvar")) {
 				varname = ast_strdupa(v->value);
-				if ((varval = strchr(varname,'='))) {
+				if (varname && (varval = strchr(varname,'='))) {
 					*varval = '\0';
 					varval++;
 					if((tmpvar = ast_variable_new(varname, varval))) {

Modified: team/group/autoconf_and_menuselect/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/chan_sip.c?rev=18308&r1=18307&r2=18308&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/chan_sip.c (original)
+++ team/group/autoconf_and_menuselect/channels/chan_sip.c Fri Apr  7 11:25:54 2006
@@ -1931,9 +1931,12 @@
 		char *tmpcall;
 		char *c;
 		tmpcall = ast_strdupa(r->callid);
-		if ((c = strchr(tmpcall, '@'))) {
-			*c = '\0';
-			ast_string_field_build(r, callid, "%s@%s", tmpcall, peer->fromdomain);
+		if (tmpcall) {
+			c = strchr(tmpcall, '@');
+			if (c) {
+				*c = '\0';
+				ast_string_field_build(r, callid, "%s@%s", tmpcall, peer->fromdomain);
+			}
 		}
 	}
 	if (ast_strlen_zero(r->tohost)) {
@@ -12506,7 +12509,7 @@
 			ast_copy_string(user->subscribecontext, v->value, sizeof(user->subscribecontext));
 		} else if (!strcasecmp(v->name, "setvar")) {
 			varname = ast_strdupa(v->value);
-			if ((varval = strchr(varname,'='))) {
+			if (varname && (varval = strchr(varname,'='))) {
 				*varval = '\0';
 				varval++;
 				if ((tmpvar = ast_variable_new(varname, varval))) {
@@ -12815,7 +12818,7 @@
 		} else if (!strcasecmp(v->name, "setvar")) {
 			/* Set peer channel variable */
 			varname = ast_strdupa(v->value);
-			if ((varval = strchr(varname,'='))) {
+			if (varname && (varval = strchr(varname,'='))) {
 				*varval = '\0';
 				varval++;
 				if ((tmpvar = ast_variable_new(varname, varval))) {
@@ -13518,11 +13521,13 @@
 			return 0;
 		}
 		if ((localtmp = strstr(tmp, "sip:")) && (localtmp = strchr(localtmp, '@'))) {
-			char lhost[80] = "", lport[80] = "";
+			char lhost[80], lport[80];
+			memset(lhost, 0, sizeof(lhost));
+			memset(lport, 0, sizeof(lport));
 			localtmp++;
 			/* This is okey because lhost and lport are as big as tmp */
 			sscanf(localtmp, "%[^<>:; ]:%[^<>:; ]", lhost, lport);
-			if (ast_strlen_zero(lhost)) {
+			if (!strlen(lhost)) {
 				ast_log(LOG_ERROR, "Can't find the host address\n");
 				return 0;
 			}



More information about the asterisk-commits mailing list