php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch fix-iconv-return-string-buffer-size for ICONV related Bug #54053

Patch version 2011-02-25 01:46 UTC

Return to Bug #54053 | Download this patch
Patch Revisions:

Developer: r3z@pr0j3ctr3z.com

--- ext/iconv/iconv.c	2010-05-04 11:57:00.000000000 +0000
+++ ext/iconv/iconv.c	2011-02-23 00:57:13.515625000 +0000
@@ -474,6 +474,7 @@
 	*out_len = out_size - out_left;
 	out_buffer[*out_len] = '\0';
 	*out = out_buffer;
+	*out = (char *) erealloc(*out, *out_len + 1);
 
 	iconv_close(cd);
 
@@ -576,6 +577,7 @@
 	*out_p = '\0';
 	*out = out_buf;
 	*out_len = out_size;
+	*out = (char *) erealloc(*out, *out_len + 1);
 	return retval;
 #endif
 }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 05:01:27 2024 UTC