]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
whereis: avoid accessing uninitialized memory
authorxiovwx <xiovwx@gmail.com>
Thu, 23 Jan 2025 11:06:27 +0000 (11:06 +0000)
committerxiovwx <xiovwx@gmail.com>
Thu, 23 Jan 2025 11:06:27 +0000 (11:06 +0000)
misc-utils/whereis.c

index a35c1dff2cd8a1d3c8df1db16610b03468e2de46..b575e57aeea561caad38819ada1cf466231c8142 100644 (file)
@@ -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;