[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 14/17: [troff]: Add paranoia to `token::description()`.
From: |
G. Branden Robinson |
Subject: |
[groff] 14/17: [troff]: Add paranoia to `token::description()`. |
Date: |
Wed, 9 Aug 2023 18:00:33 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 3672e67199c97f4bd8134a9a32569c446369d343
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Aug 5 10:59:47 2023 -0500
[troff]: Add paranoia to `token::description()`.
* src/roff/troff/input.cpp (token::description): Clear static buffer on
entry to function to avoid another problem like Savannah #62813.
---
ChangeLog | 8 ++++++++
src/roff/troff/input.cpp | 1 +
2 files changed, 9 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index d00f67f25..b71cd2a15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-08-05 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [troff]: Add paranoia to `token::description()`.
+
+ * src/roff/troff/input.cpp (token::description): Clear static
+ buffer on entry to function to avoid another problem like
+ Savannah #62813.
+
2023-08-05 G. Branden Robinson <g.branden.robinson@gmail.com>
[troff]: Trivially refactor (`define_color`).
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index ffcee1668..571370faf 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2505,6 +2505,7 @@ const char *token::description()
{
const size_t bufsz = strlen("character 'x'") + 1;
static char buf[bufsz];
+ (void) memset(buf, 0, bufsz);
switch (type) {
case TOKEN_BACKSPACE:
return "a backspace character";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 14/17: [troff]: Add paranoia to `token::description()`.,
G. Branden Robinson <=