[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/9] sys-file-reader: Check that multiple response set names begi
From: |
Ben Pfaff |
Subject: |
[PATCH 3/9] sys-file-reader: Check that multiple response set names begin with `$'. |
Date: |
Sun, 30 Jan 2011 20:37:34 -0800 |
This invariant was being checked by an assertion in dict_add_mrset(), so
this change avoids an assertion failure for invalid system files.
---
src/data/sys-file-reader.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c
index aff21d6..898b673 100644
--- a/src/data/sys-file-reader.c
+++ b/src/data/sys-file-reader.c
@@ -1047,6 +1047,13 @@ read_mrsets (struct sfm_reader *r, size_t size, size_t
count,
break;
mrset->name = xstrdup (name);
+ if (mrset->name[0] != '$')
+ {
+ sys_warn (r, _("`%s' does not begin with `$' at offset %zu "
+ "in MRSETS record."), mrset->name, text_pos (text));
+ break;
+ }
+
if (text_match (text, 'C'))
{
mrset->type = MRSET_MC;
--
1.7.1
- [PATCH 0/9] sys-file-reader fixes and tests, Ben Pfaff, 2011/01/30
- [PATCH 3/9] sys-file-reader: Check that multiple response set names begin with `$'.,
Ben Pfaff <=
- [PATCH 2/9] sys-file-reader: Fix double-free on read of partial record., Ben Pfaff, 2011/01/30
- [PATCH 7/9] sys-file-reader: Avoid redundant "within system file" in messages., Ben Pfaff, 2011/01/30
- [PATCH 4/9] sys-file-reader: Add missing periods at end of error messages., Ben Pfaff, 2011/01/30
- [PATCH 6/9] sys-file-reader: Improve debugging usefulness of error messages., Ben Pfaff, 2011/01/30
- [PATCH 1/9] hash-functions: Use C instead of preprocessor to test size of double., Ben Pfaff, 2011/01/30
- [PATCH 5/9] sys-file-reader: Really enable warnings for invalid variable formats., Ben Pfaff, 2011/01/30
- [PATCH 8/9] sys-file-reader: Elevate invalid number of labels from warning to error., Ben Pfaff, 2011/01/30
- [PATCH 9/9] sys-file-reader: Add tests., Ben Pfaff, 2011/01/30