]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/xundump.c
Make xundump report invalid record IDs
[empserver] / src / lib / common / xundump.c
index 652e59c94d1dd01a12a9b0ec0acca0575d97b6cb..74a274caa85cde5b031b3fefb495d0bccb474e46 100644 (file)
@@ -523,8 +523,11 @@ setnum(int fldno, double dbl)
     /*
      * If this is the record index, put it into cur_id.
      */
     /*
      * If this is the record index, put it into cur_id.
      */
-    if (fldno == 0 && ca->ca_table == cur_type)
+    if (fldno == 0 && ca->ca_table == cur_type) {
+       if (dbl < 0 || (int)dbl != dbl)
+           return gripe("Field %d can't hold this value", fldno + 1);
        cur_id = (int)dbl;
        cur_id = (int)dbl;
+    }
 
     memb_ptr = getobj();
     if (!memb_ptr)
 
     memb_ptr = getobj();
     if (!memb_ptr)