From: Ben Pfaff Date: Sun, 30 Jan 2011 23:35:48 +0000 (-0800) Subject: sys-file-reader: Check that multiple response set names begin with `$'. X-Git-Tag: v0.7.7~89 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=207dcaa849d7c1d5090f198e9c86f9bfc484a89e;p=pspp-builds.git sys-file-reader: Check that multiple response set names begin with `$'. This invariant was being checked by an assertion in dict_add_mrset(), so this change avoids an assertion failure for invalid system files. --- diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index aff21d60..898b6739 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;