Follow-up Comment #5, bug #66079 (group groff):

[comment #4 comment #4:]
> Sorry, I attached the wrong .second patch. Now attaching the right one.
> 
> (file #56372)

Thanks.  I see.  That's a separate issue; these are two unrelated local
variables called `s`.


From c19274b6ec048aa8c9d5e78bec22609aadf0ff4c Mon Sep 17 00:00:00 2001
From: Lukas Javorsky <ljavo...@redhat.com>
Date: Mon, 12 Aug 2024 15:45:45 +0200
Subject: [PATCH 5/7] Initialize "s" to prevent undefined behavior

---
 src/roff/troff/env.cpp   | 2 +-
 src/roff/troff/input.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 6bc65105b..13c146e12 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -295,7 +295,7 @@ void leader_character()
 
 void environment::add_char(charinfo *ci)
 {
-  int s;
+  int s = 0;
   node *gc_np = 0 /* nullptr */;
   if (line_interrupted)
     ;


I'll study this patch (specifically, the data flow of `s` contents), and if I
commit will try harder to remember to identify you as the commit author.  (I
failed to do so in bug #66081.) 


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66079>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to