[svn-commits] russell: branch 1.8 r290713 - in /branches/1.8: ./ main/pbx.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 7 06:00:55 CDT 2010


Author: russell
Date: Thu Oct  7 06:00:52 2010
New Revision: 290713

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=290713
Log:
Merged revisions 290712 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r290712 | russell | 2010-10-07 12:53:56 +0200 (Thu, 07 Oct 2010) | 4 lines
  
  Don't crash when Set() is called without a value.
  
  Review: https://reviewboard.asterisk.org/r/949/
........

Modified:
    branches/1.8/   (props changed)
    branches/1.8/main/pbx.c

Propchange: branches/1.8/
------------------------------------------------------------------------------
Binary property 'branch-1.6.2-merged' - no diff available.

Modified: branches/1.8/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/pbx.c?view=diff&rev=290713&r1=290712&r2=290713
==============================================================================
--- branches/1.8/main/pbx.c (original)
+++ branches/1.8/main/pbx.c Thu Oct  7 06:00:52 2010
@@ -9550,11 +9550,18 @@
 	mydata = ast_strdupa(data);
 	name = strsep(&mydata, "=");
 	value = mydata;
-	if (strchr(name, ' '))
+	if (!value) {
+		ast_log(LOG_WARNING, "Set requires an '=' to be a valid assignment.\n");
+		return 0;
+	}
+
+	if (strchr(name, ' ')) {
 		ast_log(LOG_WARNING, "Please avoid unnecessary spaces on variables as it may lead to unexpected results ('%s' set to '%s').\n", name, mydata);
+	}
 
 	pbx_builtin_setvar_helper(chan, name, value);
-	return(0);
+
+	return 0;
 }
 
 int pbx_builtin_setvar_multiple(struct ast_channel *chan, const char *vdata)




More information about the svn-commits mailing list