libselinux/0015-libselinux-label_x-init-drop-dead-assignment.patch
Petr Lautrbach 041eacc63c libselinux-3.2-5
Rebase on upstream commit 32611aea6543

See
    $ cd SELinuxProject/selinux
    $ git log --pretty=oneline libselinux-3.2..32611aea6543 -- libselinux

Related: rhbz#1938789
2021-07-30 12:03:09 +02:00

34 lines
1004 B
Diff

From 9c26043af6e4947e0e3e7fb789452da0c66e11c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Mon, 3 May 2021 17:11:01 +0200
Subject: [PATCH] libselinux: label_x::init(): drop dead assignment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The variable `lineno` is only used in the preceding loop and is always
set prior that to 0.
Found by clang-analyzer.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
libselinux/src/label_x.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libselinux/src/label_x.c b/libselinux/src/label_x.c
index 9674529931a7..e9fa063fafff 100644
--- a/libselinux/src/label_x.c
+++ b/libselinux/src/label_x.c
@@ -146,7 +146,6 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
if (process_line(path, line_buf, pass, ++lineno, rec))
goto finish;
}
- lineno = 0;
if (pass == 0) {
if (data->nspec == 0) {
--
2.32.0