pspp-dev
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]