-more debug messages
[oweals/gnunet.git] / src / namestore / plugin_namestore_sqlite.c
index f6858876e358e79fc97be9d66db2b43c35953151..b3f57033a563c3f872fd15a2c3a64caa41efa0af 100644 (file)
@@ -591,6 +591,13 @@ get_record_and_call_iterator (struct Plugin *plugin,
       GNUNET_break (0);
       ret = GNUNET_SYSERR;
     }
+    else if (record_count > 64 * 1024)
+    {
+      /* sanity check, don't stack allocate far too much just
+        because database might contain a large value here */
+      GNUNET_break (0);
+      ret = GNUNET_SYSERR;
+    } 
     else
     {
       struct GNUNET_NAMESTORE_RecordData rd[record_count];
@@ -601,7 +608,6 @@ get_record_and_call_iterator (struct Plugin *plugin,
       {
        GNUNET_break (0);
        ret = GNUNET_SYSERR;
-       record_count = 0;
       }
       else
       {