projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f994fab
)
sys-file-reader: Check that multiple response set names begin with `$'.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 30 Jan 2011 23:35:48 +0000
(15:35 -0800)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Mon, 31 Jan 2011 04:34:34 +0000
(20: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
patch
|
blob
|
history
diff --git
a/src/data/sys-file-reader.c
b/src/data/sys-file-reader.c
index aff21d60b884cd7332418d512855899b1d60e6b6..898b6739475b3fedc2e5ae29855747997a3d34f0 100644
(file)
--- 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;