]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: Fix uninicialized error variable
authorPavel Reichl <preichl@redhat.com>
Thu, 30 May 2024 22:38:18 +0000 (00:38 +0200)
committerCarlos Maiolino <cem@kernel.org>
Mon, 17 Jun 2024 11:55:51 +0000 (13:55 +0200)
To silence redhat's covscan checker:

Error: UNINIT (CWE-457): [#def1] [important]
xfsprogs-6.4.0/db/hash.c:308:2: var_decl: Declaring variable "error" without initializer.
xfsprogs-6.4.0/db/hash.c:353:2: uninit_use: Using uninitialized value "error".

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
db/hash.c

index 05a94f249c3d6417e8d59e0deaa2805eb6563c5b..9b3fdea6c413643799423adab1531fd0ede32ca4 100644 (file)
--- a/db/hash.c
+++ b/db/hash.c
@@ -304,7 +304,7 @@ collide_xattrs(
        struct dup_table        *tab = NULL;
        xfs_dahash_t            old_hash;
        unsigned long           i;
-       int                     error;
+       int                     error = 0;
 
        old_hash = libxfs_da_hashname((uint8_t *)name, namelen);