[asterisk-commits] dvossel: branch dvossel/sip_string_parse_testing r244494 - in /team/dvossel/s...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 2 18:16:41 CST 2010


Author: dvossel
Date: Tue Feb  2 18:16:37 2010
New Revision: 244494

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244494
Log:
fixes registration bug, addes new test to sip_parse_host

Modified:
    team/dvossel/sip_string_parse_testing/channels/chan_sip.c
    team/dvossel/sip_string_parse_testing/channels/sip/config_parser.c

Modified: team/dvossel/sip_string_parse_testing/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/sip_string_parse_testing/channels/chan_sip.c?view=diff&rev=244494&r1=244493&r2=244494
==============================================================================
--- team/dvossel/sip_string_parse_testing/channels/chan_sip.c (original)
+++ team/dvossel/sip_string_parse_testing/channels/chan_sip.c Tue Feb  2 18:16:37 2010
@@ -6268,8 +6268,7 @@
 	ast_atomic_fetchadd_int(&regobjs, 1);
 	ASTOBJ_INIT(reg);
 
-	if (!sip_parse_register_line(reg, value, lineno)) {
-		/* release the reference given by ASTOBJ_INIT. The container has another reference */
+	if (sip_parse_register_line(reg, value, lineno)) {
 		registry_unref(reg, "failure to parse, unref the reg pointer");
 		return -1;
 	}

Modified: team/dvossel/sip_string_parse_testing/channels/sip/config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/sip_string_parse_testing/channels/sip/config_parser.c?view=diff&rev=244494&r1=244493&r2=244494
==============================================================================
--- team/dvossel/sip_string_parse_testing/channels/sip/config_parser.c (original)
+++ team/dvossel/sip_string_parse_testing/channels/sip/config_parser.c Tue Feb  2 18:16:37 2010
@@ -511,6 +511,9 @@
 {
 	char *port;
 
+	if (ast_strlen_zero(line)) {
+		return -1;
+	}
 	if ((*hostname = strstr(line, "://"))) {
 		*hostname += 3;
 
@@ -627,6 +630,15 @@
 		res = AST_TEST_FAIL;
 	}
 	return res;
+
+	/* test 6, expected failure with NULL input */
+	if (sip_parse_host(NULL, 1, &host, &port, &transport)) {
+
+		ast_str_append(&args->ast_test_error_str, 0, "Test 6: expected error on NULL input did not occur.\n");
+		res = AST_TEST_FAIL;
+	}
+	return res;
+
 }
 
 /*! \brief SIP test registration */




More information about the asterisk-commits mailing list