Skip to content

Commit 1709d41

Browse files
committed
Promote warning to exception in the convert_uudecode() function
1 parent 889d598 commit 1709d41

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

ext/standard/tests/strings/bug67252.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
Bug #67252 (convert_uudecode out-of-bounds read)
33
--FILE--
44
<?php
5-
6-
$a = "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A"."\n"."a.";
7-
var_dump(convert_uudecode($a));
8-
5+
try {
6+
convert_uudecode("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A" . "\n" . "a.");
7+
} catch (ValueError $exception) {
8+
echo $exception->getMessage() . "\n";
9+
}
910
?>
10-
--EXPECTF--
11-
Warning: convert_uudecode(): The given parameter is not a valid uuencoded string in %s on line %d
12-
bool(false)
11+
--EXPECT--
12+
The given parameter is not a valid uuencoded string

ext/standard/uuencode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ PHP_FUNCTION(convert_uudecode)
222222
if (ZSTR_LEN(src) < 1) { RETURN_FALSE; }
223223

224224
if ((dest = php_uudecode(ZSTR_VAL(src), ZSTR_LEN(src))) == NULL) {
225-
php_error_docref(NULL, E_WARNING, "The given parameter is not a valid uuencoded string");
226-
RETURN_FALSE;
225+
zend_value_error("The given parameter is not a valid uuencoded string");
226+
return;
227227
}
228228

229229
RETURN_STR(dest);

0 commit comments

Comments
 (0)