util-linux/backport-whereis-avoid-accessing-uninitialized-memory.patch

28 lines
822 B
Diff
Raw Normal View History

2025-03-03 20:09:13 +08:00
From 7e06d474b17b9b74aa8e4b8a42ab394c1f80b1fd Mon Sep 17 00:00:00 2001
From: xiovwx <xiovwx@gmail.com>
Date: Thu, 23 Jan 2025 11:06:27 +0000
Subject: [PATCH] whereis: avoid accessing uninitialized memory
Reference:https://github.com/util-linux/util-linux/commit/7e06d474b17b9b74aa8e4b8a42ab394c1f80b1fd
Conflict:NA
---
misc-utils/whereis.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
index a35c1dff..b575e57a 100644
--- a/misc-utils/whereis.c
+++ b/misc-utils/whereis.c
@@ -471,7 +471,7 @@ static void findin(const char *dir, const char *pattern, int *count,
static void lookup(const char *pattern, struct wh_dirlist *ls, int want)
{
- char patbuf[PATH_MAX];
+ char patbuf[PATH_MAX] = { 0 };
int count = 0;
char *wait = NULL, *p;
--
2.33.0