Commit 4e88c9a4 authored by Paragon Initiative Enterprises's avatar Paragon Initiative Enterprises
Browse files

Add missing bounds check

No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
...@@ -196,7 +196,7 @@ abstract class Base32 implements EncoderInterface ...@@ -196,7 +196,7 @@ abstract class Base32 implements EncoderInterface
return ''; return '';
} }
if (($srcLen & 7) === 0) { if (($srcLen & 7) === 0) {
for ($j = 0; $j < 7; ++$j) { for ($j = 0; $j < 7 && $j < $srcLen; ++$j) {
if ($encodedString[$srcLen - $j] === '=') { if ($encodedString[$srcLen - $j] === '=') {
throw new InvalidArgumentException( throw new InvalidArgumentException(
"decodeNoPadding() doesn't tolerate padding" "decodeNoPadding() doesn't tolerate padding"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment