device-mapper-multipath/0109-kpartx-fix-theoretical-overflow-in-loop-device-name.patch
Benjamin Marzinski 2d7060ef7c device-mapper-multipath-0.8.7-28
Add 0108-libmultipath-actually-truncate-too-large-vpd-page.patch
Add 0109-kpartx-fix-theoretical-overflow-in-loop-device-name.patch
  * Fixes RHEL-31793 ("RHEL SAST Automation: address (selected) true
    positives")
Resolves: RHEL-31793

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
2024-04-10 18:41:35 -04:00

24 lines
787 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Tue, 9 Apr 2024 14:13:34 -0400
Subject: [PATCH] kpartx: fix theoretical overflow in loop device name
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
kpartx/lopart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kpartx/lopart.c b/kpartx/lopart.c
index 9b652554..80ce1312 100644
--- a/kpartx/lopart.c
+++ b/kpartx/lopart.c
@@ -159,7 +159,7 @@ char *find_loop_by_file(const char *filename)
char *find_unused_loop_device(void)
{
- char dev[20], *next_loop_dev = NULL;
+ char dev[21], *next_loop_dev = NULL;
int fd, next_loop = 0, somedev = 0, someloop = 0, loop_known = 0;
struct stat statbuf;
struct loop_info loopinfo;