gbranden pushed a commit to branch master
in repository groff.
commit f0086085a82538329d58ee8ac9f6c1dde906de29
Author: Lukas Javorsky <[email protected]>
AuthorDate: Mon Aug 12 13:46:56 2024 +0000
[troff]: Fix Savannah #66079.
* src/roff/troff/input.cpp (token::add_to_zero_width_node_list):
Initialize stack-allocated variable that is not populated by all paths
through this function.
Fixes <https://savannah.gnu.org/bugs/?66079>.
[Also throw the developer a bone by annotating what this variable is
_for_. --GBR]
---
ChangeLog | 8 ++++++++
src/roff/troff/input.cpp | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 63dbf84de..3925f6a70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-08-14 Lukas Javorsky <[email protected]>
+
+ * src/roff/troff/input.cpp (token::add_to_zero_width_node_list):
+ Initialize stack-allocated variable that is not populated by all
+ paths through this function.
+
+ Fixes <https://savannah.gnu.org/bugs/?66079>.
+
2024-08-14 G. Branden Robinson <[email protected]>
[troff]: Slightly refactor: boolify.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 3eae78e68..44390f895 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -7578,7 +7578,7 @@ void check_missing_character()
bool token::add_to_zero_width_node_list(node **pp)
{
hunits w;
- int s;
+ int s = 0; /* space count, possibly populated by `nspaces()` */
node *n = 0 /* nullptr */;
switch (type) {
case TOKEN_CHAR:
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit