summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDemi Marie Obenour <demiobenour@gmail.com>2021-01-09 23:42:56 -0500
committerPanu Matilainen <pmatilai@redhat.com>2021-03-22 12:12:12 +0200
commit55f569e363d124667a8dc49ae2ec555ebf283370 (patch)
treed9a5c8e7bb16630996675dee86c711228131ad89
parentae835edf6d1843ce732cab87f37dae481bbb5b8f (diff)
downloadrpm-55f569e363d124667a8dc49ae2ec555ebf283370.tar.gz
Verify that data does not overlap region trailer
This is already checked for other header entries. (cherry picked from commit f29c43728c492b1dbfe50136d33bf12f3704d8a0)
-rw-r--r--lib/header.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/header.c b/lib/header.c
index 9ec7ed0e4..1256e652c 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -298,6 +298,15 @@ static rpmRC hdrblobVerifyInfo(hdrblob blob, char **emsg)
end = info.offset + len;
if (hdrchkRange(blob->dl, end) || len <= 0)
goto err;
+ if (blob->regionTag) {
+ /*
+ * Verify that the data does not overlap the region trailer. The
+ * region trailer is skipped by this loop, so the other checks
+ * don’t catch this case.
+ */
+ if (end > blob->rdl - REGION_TAG_COUNT && info.offset < blob->rdl)
+ goto err;
+ }
}
return 0; /* Everything ok */