Skip to content

Instantly share code, notes, and snippets.

/72850.diff Secret

Created Aug 16, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.