From 9513c968dbdf6c3dc6bd78dd57bc7d5818895110 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 2 Feb 2022 11:49:16 +0100 Subject: [PATCH] fix the sanity checking for valid revisions --- src/runtime/c/pgf/db.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/c/pgf/db.cxx b/src/runtime/c/pgf/db.cxx index 0d63dd2f1..5da410cc8 100644 --- a/src/runtime/c/pgf/db.cxx +++ b/src/runtime/c/pgf/db.cxx @@ -1433,7 +1433,7 @@ ref PgfDB::revision2pgf(PgfRevision revision) throw pgf_error("Invalid revision"); ref pgf = revision; - if (chunksize(chunk) != request2size(sizeof(PgfPGF)+pgf->name.size+1)) + if (chunksize(chunk) - request2size(sizeof(PgfPGF)+pgf->name.size+1) > MINSIZE) throw pgf_error("Invalid revision"); return pgf; @@ -1477,7 +1477,7 @@ ref PgfDB::revision2concr(PgfConcrRevision revision) throw pgf_error("Invalid revision"); ref concr = revision; - if (chunksize(chunk) != request2size(sizeof(PgfConcr)+concr->name.size+1)) + if (chunksize(chunk) - request2size(sizeof(PgfConcr)+concr->name.size+1) > MINSIZE) throw pgf_error("Invalid revision"); return concr;