gbranden pushed a commit to branch master
in repository groff.
commit fe8854dbe6c320482e6dd1052cda060c8f5f6319
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Oct 18 21:47:32 2026 -0500
[troff]: Fix Savannah #68797.
* src/roff/troff/input.cpp (rename_macro): Replace assert(3)ion that
could be tripped by invalid characters in macro/string/request/
diversion identifier with skip of input line.
Fixes <https://savannah.gnu.org/bugs/?68797>.
---
ChangeLog | 10 ++++++++++
src/roff/troff/input.cpp | 6 +++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 9690bbc12..f05c1c3bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-10-18 G. Branden Robinson <[email protected]>
+
+ [troff]: Fix Savannah #68797.
+
+ * src/roff/troff/input.cpp (rename_macro): Replace assert(3)ion
+ that could be tripped by invalid characters in macro/string/
+ request/diversion identifier with skip of input line.
+
+ Fixes <https://savannah.gnu.org/bugs/?68797>.
+
2026-10-18 G. Branden Robinson <[email protected]>
[groff]: Regression-test Savannah #68797.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 0bb201d2a..9d107fca8 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5859,7 +5859,11 @@ static void rename_macro() // .rn
return;
}
symbol s1 = read_identifier();
- assert(s1 != 0 /* nullptr */);
+ if (s1.is_null()) {
+ // The identifier was garbage, like `a\&b`.
+ skip_line();
+ return;
+ }
if (!s1.is_null()) {
symbol s2 = read_identifier();
if (s2.is_null())
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit