[asterisk-commits] sgriepentrog: branch 11 r408137 - /branches/11/main/format.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 14 15:27:15 CST 2014


Author: sgriepentrog
Date: Fri Feb 14 15:27:09 2014
New Revision: 408137

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408137
Log:
format.c: correct possible null pointer dereference

In ast_format_sdp_parse and ast_format_sdp_generate
the check checks for a valid interface and function
were potentially confusing, and hid an error in the
test of the presence of the function that is called
later.  This patch clears up and corrects the test.

(closes issue ASTERISK-23098)
Reported by: marcelloceschia
Patches:
     main_format.patch uploaded by marcelloceschia (license 6036)
	 ASTERISK-23098.patch uploaded by coreyfarrell (license 5909)


Modified:
    branches/11/main/format.c

Modified: branches/11/main/format.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/format.c?view=diff&rev=408137&r1=408136&r2=408137
==============================================================================
--- branches/11/main/format.c (original)
+++ branches/11/main/format.c Fri Feb 14 15:27:09 2014
@@ -129,7 +129,7 @@
 	}
 
 	ao2_rdlock(wrapper);
-	if (!(wrapper->interface || !wrapper->interface->format_attr_sdp_parse)) {
+	if (!wrapper->interface || !wrapper->interface->format_attr_sdp_parse) {
 		ao2_unlock(wrapper);
 		ao2_ref(wrapper, -1);
 		return 0;
@@ -152,7 +152,7 @@
 	}
 
 	ao2_rdlock(wrapper);
-	if (!(wrapper->interface || !wrapper->interface->format_attr_sdp_generate)) {
+	if (!wrapper->interface || !wrapper->interface->format_attr_sdp_generate) {
 		ao2_unlock(wrapper);
 		ao2_ref(wrapper, -1);
 		return;




More information about the asterisk-commits mailing list