From 8ce015742d32a390f965e5d75252fd0a73aef388 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 29 May 2021 22:57:01 +0430 Subject: [PATCH] LibWasm: Fix logic error in Limits::parse() The check was negated, and it errored out when the read actually succeeded. --- Userland/Libraries/LibWasm/Parser/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWasm/Parser/Parser.cpp b/Userland/Libraries/LibWasm/Parser/Parser.cpp index bfe32b84a6..43c9a98263 100644 --- a/Userland/Libraries/LibWasm/Parser/Parser.cpp +++ b/Userland/Libraries/LibWasm/Parser/Parser.cpp @@ -190,7 +190,7 @@ ParseResult Limits::parse(InputStream& stream) Optional max; if (flag) { size_t value; - if (LEB128::read_unsigned(stream, value)) + if (!LEB128::read_unsigned(stream, value)) return with_eof_check(stream, ParseError::ExpectedSize); max = value; }