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 '\'':