sys-file-reader: Avoid null dereference skipping bad extension record 18.
[pspp] / src / data / sys-file-reader.c
index b49ccf785675639aa48dffd77a279e1e1d501a82..1745d1dcf2db165bf8c3f3f149bd405532e634f3 100644 (file)
@@ -523,7 +523,7 @@ read_record (struct sfm_reader *r, int type,
              18.  I'm surprised that SPSS puts up with this. */
           struct sfm_extension_record *ext;
           bool ok = read_extension_record (r, subtype, &ext);
-          if (ok)
+          if (ok && ext)
             ll_push_tail (&r->var_attrs, &ext->ll);
           return ok;
         }