commit 112b75eb56d98c442094966fe59cbf3cd5feb909
parent 0d5ea5ca58a34b3b0d9cd6dd60e5387000b4445a
Author: Armin Preiml <apreiml@strohwolke.at>
Date: Wed, 21 Jun 2023 15:51:35 +0200
base64: avoid infite loop in decoder
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/encoding/base64/base64.ha b/encoding/base64/base64.ha
@@ -341,6 +341,9 @@ fn decode_reader(
for (nr < nn) {
match (io::read(s.in, buf[nr..])) {
case let n: size =>
+ if (n == 0) {
+ break;
+ };
nr += n;
case io::EOF =>
s.state = io::EOF;