Blame SOURCES/0029-optimize-Do-not-return-garbage-from-stack.patch

4cfa1d
From 9b3e5589c5e1b6ced176ce33f59774a3b1d28c36 Mon Sep 17 00:00:00 2001
4cfa1d
From: Phil Sutter <psutter@redhat.com>
4cfa1d
Date: Tue, 21 Feb 2023 19:50:41 +0100
4cfa1d
Subject: [PATCH] optimize: Do not return garbage from stack
4cfa1d
4cfa1d
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2160049
4cfa1d
Upstream Status: nftables commit d4d47e5bdf943
4cfa1d
4cfa1d
commit d4d47e5bdf943be494aeb5d5a29b8f5212acbddf
4cfa1d
Author: Phil Sutter <phil@nwl.cc>
4cfa1d
Date:   Fri Jan 13 17:09:53 2023 +0100
4cfa1d
4cfa1d
    optimize: Do not return garbage from stack
4cfa1d
4cfa1d
    If input does not contain a single 'add' command (unusual, but
4cfa1d
    possible), 'ret' value was not initialized by nft_optimize() before
4cfa1d
    returning its value.
4cfa1d
4cfa1d
    Fixes: fb298877ece27 ("src: add ruleset optimization infrastructure")
4cfa1d
    Signed-off-by: Phil Sutter <phil@nwl.cc>
4cfa1d
4cfa1d
Signed-off-by: Phil Sutter <psutter@redhat.com>
4cfa1d
---
4cfa1d
 src/optimize.c | 2 +-
4cfa1d
 1 file changed, 1 insertion(+), 1 deletion(-)
4cfa1d
4cfa1d
diff --git a/src/optimize.c b/src/optimize.c
4cfa1d
index 3a3049d..6514cbb 100644
4cfa1d
--- a/src/optimize.c
4cfa1d
+++ b/src/optimize.c
4cfa1d
@@ -1017,7 +1017,7 @@ static int cmd_optimize(struct nft_ctx *nft, struct cmd *cmd)
4cfa1d
 int nft_optimize(struct nft_ctx *nft, struct list_head *cmds)
4cfa1d
 {
4cfa1d
 	struct cmd *cmd;
4cfa1d
-	int ret;
4cfa1d
+	int ret = 0;
4cfa1d
 
4cfa1d
 	list_for_each_entry(cmd, cmds, list) {
4cfa1d
 		switch (cmd->op) {
4cfa1d
-- 
4cfa1d
2.39.2
4cfa1d