Update of bug #68973 (group groff):
Status: Confirmed => In Progress
Summary: [troff] reporting hyphenation word of maximum
characteristics crashes with SIGILL since groff 1.25.0 => [PATCH] [troff]
reporting hyphenation word of maximum characteristics crashes with SIGILL
since groff 1.25.0
_______________________________________________________
Follow-up Comment #1:
diff --git a/ChangeLog b/ChangeLog
index 151bdceca..4fdb32022 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-11-28 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp
+ (print_hyphenation_exception_words_request): Size `outputbuflen`
+ adequately to house a hyphenation word of maximal
+ characteristics: or `WORD_MAX` length with a hyphenation break
+ after every character.
+
+ Fixes <https://savannah.gnu.org/bugs/?68973>. Problem
+ introduced by me with `phw` argument handling in commit
+ 89373c759b, 12 April.
+
2026-11-28 G. Branden Robinson <[email protected]>
[groff]: Regression-test Savannah #68973.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 8e5052404..2e8f7035b 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -4217,10 +4217,11 @@ static void
print_hyphenation_exception_words_request() // .phw
symbol entry;
unsigned char *hypoint;
// Pathologically, we could have a hyphenation point after every
- // character in a word except the last. The word may have a trailing
- // space; see `hyphen_trie::interpret_patterns_file()`.
+ // character in a word except the last.
// C++11: constexpr
- static const size_t outputbuflen = WORD_MAX * 2;
+ static const size_t outputbuflen = (WORD_MAX * 2)
+ + 1 /* leading '#' (see below) */
+ + 1 /* '\0' */;
// C++03: char outputbuf[outputbuflen]();
char outputbuf[outputbuflen]; // `errprint()`able , so not `unsigned`
(void) memset(outputbuf, '\0', outputbuflen);
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68973>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
