Browse Source

MFB: Properly address incomplete multibyte chars inside escapeshellcmd()

PHP-5.2.1RC1
Ilia Alshanetsky 19 years ago
parent
commit
233c3ade12
  1. 2
      NEWS
  2. 5
      ext/standard/exec.c

2
NEWS

@ -1,6 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Mar 2008 , PHP 5.2.6
- Properly address incomplete multibyte chars inside escapeshellcmd() (Ilia,
Stefan Esser)
- Fixed bug #44440 (st_blocks undefined under BeOS). (Felipe)
- Fixed bug #44394 (Last two bytes missing from output). (Felipe)
- Fixed bug #44388 (Crash inside exif_read_data() on invalid images) (Ilia)

5
ext/standard/exec.c

@ -270,6 +270,11 @@ char *php_escape_shell_cmd(char *str) {
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 '\'':

Loading…
Cancel
Save