dcavalca / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
629b27
From 3372e6c917e54b3a84c04ca4274000da04a98e86 Mon Sep 17 00:00:00 2001
629b27
From: chantra <chantr4@gmail.com>
629b27
Date: Thu, 17 Feb 2022 08:54:47 -0800
629b27
Subject: [PATCH 26/30] fix integer underflow in vfyFDCb
629b27
629b27
---
629b27
 lib/rpmchecksig.c | 2 +-
629b27
 1 file changed, 1 insertion(+), 1 deletion(-)
629b27
629b27
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c
629b27
index 5e8794e2d..7ad4e7034 100644
629b27
--- a/lib/rpmchecksig.c
629b27
+++ b/lib/rpmchecksig.c
629b27
@@ -345,7 +345,7 @@ static int vfyFDCb(struct rpmsinfo_s *sinfo, void *cbdata)
629b27
     struct vfydatafd_s *vd = cbdata;
629b27
     char *vmsg, *msg;
629b27
     size_t n;
629b27
-    size_t remainder = BUFSIZ - vd->len;
629b27
+    size_t remainder = BUFSIZ - vd->len >= 0 ? BUFSIZ - vd->len : 0;
629b27
 
629b27
     vmsg = rpmsinfoMsg(sinfo);
629b27
     rasprintf(&msg, "    %s\n", vmsg);
629b27
-- 
629b27
2.35.1
629b27