tags 491211 + patch
stop

Hello

It seem that the upstream author already fixed that problem in CVS but did
not release it since 2004!

Please find attached the diff. The corresponding changelog entry is:

 $ cvs log -r0.34 -r0.35 idn.c
 ...
 revision 0.35
 date: 2007-11-26 22:20:24 +0100;  author: turbo;  state: Exp;  lines: +17 -5;  
commitid: OkbAaG1zpBlx78Hs;
 Catch NULL return from idn(). Patch by Daniel Janecke.

The patch is also pretty easy to understand - and it works fine :)

bye,

-christian-


-- 
NetCologne Gesellschaft für Telekommunikation mbH
Network Engineering & Design
Am Coloneum 9                                     Tel.: +49-221-2222-8711
50829 Köln                                        Fax.: +49-221-2222-78711
Geschäftsführer: Werner Hanf, Karl-Heinz Zankel         HRB 25580, AG Köln
Index: idn.c
===================================================================
RCS file: /var/cvs/php-modules/idn/idn.c,v
retrieving revision 0.34
retrieving revision 0.35
diff -u -r0.34 -r0.35
--- idn.c	24 Nov 2006 09:34:47 -0000	0.34
+++ idn.c	26 Nov 2007 21:20:24 -0000	0.35
@@ -24,7 +24,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: idn.c,v 0.34 2006-11-24 09:34:47 turbo Exp $ */
+/* $Id: idn.c,v 0.35 2007-11-26 21:20:24 turbo Exp $ */
 
 /* {{{ PHP defines and includes
  */
@@ -196,7 +196,7 @@
 {
 	php_info_print_table_start();
 	php_info_print_table_row(2, "IDN support", "enabled");
-	php_info_print_table_row(2, "RCS Version", "$Id: idn.c,v 0.34 2006-11-24 09:34:47 turbo Exp $" );
+	php_info_print_table_row(2, "RCS Version", "$Id: idn.c,v 0.35 2007-11-26 21:20:24 turbo Exp $" );
 	php_info_print_table_row(2, "LibIDN version", STRINGPREP_VERSION);
 	php_info_print_table_end();
 	DISPLAY_INI_ENTRIES();
@@ -697,7 +697,11 @@
 	}
 
 	output = idn((*yyinput)->value.str.val, IDN_IDNA_TO_ASCII, charset);
-	RETVAL_STRINGL(output, strlen(output), 1);
+	if( output == NULL ) {
+		RETURN_NULL();
+	} else {
+		RETVAL_STRINGL(output, strlen(output), 1);
+	}
 	efree(output);
 }
 /* }}} */
@@ -723,7 +727,11 @@
 	}
 
 	output = idn((*yyinput)->value.str.val, IDN_IDNA_TO_UNICODE, "UTF-8");
-	RETVAL_STRINGL(output, strlen(output), 1);
+	if( output == NULL ) {
+		RETURN_NULL();
+	} else {
+		RETVAL_STRINGL(output, strlen(output), 1);
+	}
 	efree(output);
 }
 /* }}} */
@@ -749,7 +757,11 @@
 	}
 
 	output = idn((*yyinput)->value.str.val, IDN_IDNA_TO_UNICODE, charset);
-	RETVAL_STRINGL(output, strlen(output), 1);
+	if( output == NULL ) {
+		RETURN_NULL();
+	} else {
+		RETVAL_STRINGL(output, strlen(output), 1);
+	}
 	efree(output);
 }
 /* }}} */

Reply via email to