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
local massaging done to get it to apply to php4
--- old/ext/standard/exec.c	2007/12/31 07:17:14	1.113.2.3.2.1.2.3
+++ new/ext/standard/exec.c	2008/03/17 23:01:27	1.113.2.3.2.1.2.4
@@ -271,6 +271,11 @@
 	cmd = emalloc(2 * l + 1);
 	
 	for (x = 0, y = 0; x < l; x++) {
+		/* skip non-valid multibyte characters */
+		if (mblen(str + x, (l - x)) < 0) {
+			continue;
+		}
+
 		switch (str[x]) {
 			case '"':
 			case '\'':

