APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1529836748 -3600
# Sun Jun 24 11:39:08 2018 +0100
# Node ID 6e9d292225805586dc1b0ddf225fae19b53e0d55
# Parent 9c8dce2ccb19561548aa8c8177f27e94e7a1349c
No longer accept ?\000 silently as a converter character, doprnt.c
src/ChangeLog addition:
2018-06-24 Aidan Kehoe <kehoea(a)parhasard.net>
* doprnt.c (parse_doprnt_spec):
Don't silently accept ?\000 as a converter character in user
format strings.
(VALID_CONVERTERS): This is no longer used, and was
inaccurate. Remove it.
tests/ChangeLog addition:
2018-06-24 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/format-tests.el:
We no longer silently accept ?\000 as a converter character, check
that.
diff -r 9c8dce2ccb19 -r 6e9d29222580 src/ChangeLog
--- a/src/ChangeLog Fri Jun 15 16:05:56 2018 +0100
+++ b/src/ChangeLog Sun Jun 24 11:39:08 2018 +0100
@@ -1,3 +1,11 @@
+2018-06-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doprnt.c (parse_doprnt_spec):
+ Don't silently accept ?\000 as a converter character in user
+ format strings.
+ (VALID_CONVERTERS): This is no longer used, and was
+ inaccurate. Remove it.
+
2018-05-25 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c (Fsnarf_documentation):
diff -r 9c8dce2ccb19 -r 6e9d29222580 src/doprnt.c
--- a/src/doprnt.c Fri Jun 15 16:05:56 2018 +0100
+++ b/src/doprnt.c Sun Jun 24 11:39:08 2018 +0100
@@ -654,7 +654,6 @@
}
#define VALID_FLAGS "-+ #0&~!"
-#define VALID_CONVERTERS "dic" "ouxXp" "feEgG"
"sS" "b"
#define INT_CONVERTERS "dicoxXbp"
#define DOUBLE_CONVERTERS "feEgG"
#define STRING_CONVERTERS "sS"
@@ -1404,6 +1403,12 @@
}
}
+ if (ch == 0)
+ {
+ Dynarr_free (specs);
+ syntax_error ("Invalid converter character", make_char (ch));
+ }
+
spec.converter = ch;
spec.spec_length = fmt - text_end;
}
diff -r 9c8dce2ccb19 -r 6e9d29222580 tests/ChangeLog
--- a/tests/ChangeLog Fri Jun 15 16:05:56 2018 +0100
+++ b/tests/ChangeLog Sun Jun 24 11:39:08 2018 +0100
@@ -1,3 +1,9 @@
+2018-06-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/format-tests.el:
+ We no longer silently accept ?\000 as a converter character, check
+ that.
+
2018-06-15 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/search-tests.el:
diff -r 9c8dce2ccb19 -r 6e9d29222580 tests/automated/format-tests.el
--- a/tests/automated/format-tests.el Fri Jun 15 16:05:56 2018 +0100
+++ b/tests/automated/format-tests.el Sun Jun 24 11:39:08 2018 +0100
@@ -711,4 +711,6 @@
(format (concat "%" (number-to-string most-positive-fixnum)
"d")
1))
+(Check-Error syntax-error (format "%\000" 42))
+
;; end of format-tests.el
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)
Show replies by date