]> git.pond.sub.org Git - empserver/commitdiff
Make xundump report invalid record IDs
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 7 May 2011 15:17:06 +0000 (17:17 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Jun 2011 14:49:57 +0000 (16:49 +0200)
It failed silently before.

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 (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;
+    }
 
     memb_ptr = getobj();
     if (!memb_ptr)