[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sun, 13 Oct 2024 15:04:25 -0400 (EDT) |
branch: master
commit 49a84ec1c0aebdd2e740c4aa25f3ded6a0d47d49
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Oct 13 20:01:20 2024 +0100
* info/infokey.c (compile): warn if octal sequence is out of range.
Report from Andreas Schwab.
---
ChangeLog | 5 +++++
info/infokey.c | 13 ++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9fcc7ab617..2dba4be204 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-13 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * info/infokey.c (compile): warn if octal sequence is out of range.
+ Report from Andreas Schwab.
+
2024-10-13 Gavin Smith <gavinsmith0123@gmail.com>
Avoid compiler warning
diff --git a/info/infokey.c b/info/infokey.c
index e27d413629..ec06cec51f 100644
--- a/info/infokey.c
+++ b/info/infokey.c
@@ -376,14 +376,21 @@ compile (FILE *fp, const char *filename, int
*suppress_info, int *suppress_ea)
}
if (seqstate != octal)
{
- if (oval)
- To_seq (oval);
- else
+ if (oval == 0)
{
syntax_error (filename, lnum,
_("NUL character (\\000) not permitted"));
error = 1;
}
+ else if (oval > 0177)
+ {
+ syntax_error (filename, lnum,
+ _("invalid octal sequence for byte value (\\%o)"),
+ oval);
+ error = 1;
+ }
+ else
+ To_seq (oval);
}
break;