summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-10-18 01:48:32 +0100
committerColin Watson <cjwatson@debian.org>2022-10-18 01:48:32 +0100
commit548b5e5d597e3db4d1da1a78590f7ab5db0f9301 (patch)
treeb8f65130923cfb5e9dff360dd946ed315ae35f3c
parent976629346777a14f8c2f1e45ef7269ab8438e479 (diff)
zsoelim_open_file: Fix use of uninitialized value
In the case where `filename` has no directory part and does not contain a dot, we could reach the decision of whether to emit a "can't open %s" error message without initializing `decomp`. Noticed by `gcc -Og`. * src/zsoelim.l (zsoelim_open_file): Initialize `decomp` to NULL.
-rw-r--r--src/zsoelim.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zsoelim.l b/src/zsoelim.l
index b5579bf2..8470b343 100644
--- a/src/zsoelim.l
+++ b/src/zsoelim.l
@@ -394,7 +394,7 @@ static decompress *try_compressed (char **filename)
bool zsoelim_open_file (const char *filename, gl_list_t manpathlist,
const char *parent_path)
{
- decompress *decomp;
+ decompress *decomp = NULL;
if (parent_path)
debug ("opening %s (parent path: %s)\n",