Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > fb1832787a7adf918aad2d840f64675b > files > 23

php-5.2.4-3.5mdv2008.0.src.rpm

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/exec.c?r1=1.113.2.3.2.1.2.3&r2=1.113.2.3.2.1.2.4&view=patch
--- ext/standard/exec.c	2007/12/31 07:17:14	1.113.2.3.2.1.2.3
+++ ext/standard/exec.c	2008/03/17 23:01:27	1.113.2.3.2.1.2.4
@@ -271,6 +271,11 @@
 	cmd = safe_emalloc(2, l, 1);
 
 	for (x = 0, y = 0; x < l; x++) {
+		/* skip non-valid multibyte characters */
+		if (php_mblen(str + x, (l - x)) < 0) {
+			continue;
+		}
+
 		switch (str[x]) {
 			case '"':
 			case '\'':