Skip to content

Instantly share code, notes, and snippets.

/72850.diff Secret

Created August 16, 2016 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c8c9d299ebdc0fbc6aa345b7ba64a92e to your computer and use it in GitHub Desktop.
Save anonymous/c8c9d299ebdc0fbc6aa345b7ba64a92e to your computer and use it in GitHub Desktop.
Patch for 72850
commit f77f0edc705bbf403742029106a18924c50d40f6
Author: Stanislav Malyshev <stas@php.net>
Date: Tue Aug 16 16:03:44 2016 -0700
Fix bug #72850 - integer overflow in uuencode
diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c
index cd35c28..a31f14d 100644
--- a/ext/standard/uuencode.c
+++ b/ext/standard/uuencode.c
@@ -200,6 +200,11 @@ PHP_FUNCTION(convert_uuencode)
}
dst_len = php_uuencode(src, src_len, &dst);
+ if (dst_len < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "String too long, max length is %d", INT_MAX);
+ efree(dst);
+ RETURN_FALSE;
+ }
RETURN_STRINGL(dst, dst_len, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment