diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-11 21:02:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-11 21:02:30 +0000 |
commit | 589448a17afcc95ef157678d4e1b2eba0f0c9d7a (patch) | |
tree | d9e6c3802d6203680b7b956a60aa0c19dc50a9ff /src/namestore/plugin_namestore_sqlite.c | |
parent | d63b9b5f38df2300777e7983af7b0ae210fce626 (diff) | |
download | gnunet-589448a17afcc95ef157678d4e1b2eba0f0c9d7a.tar.gz gnunet-589448a17afcc95ef157678d4e1b2eba0f0c9d7a.zip |
-first draft of postgres namestore plugin (#2157)
Diffstat (limited to 'src/namestore/plugin_namestore_sqlite.c')
-rw-r--r-- | src/namestore/plugin_namestore_sqlite.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index f6858876e..b3f57033a 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -591,6 +591,13 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
591 | GNUNET_break (0); | 591 | GNUNET_break (0); |
592 | ret = GNUNET_SYSERR; | 592 | ret = GNUNET_SYSERR; |
593 | } | 593 | } |
594 | else if (record_count > 64 * 1024) | ||
595 | { | ||
596 | /* sanity check, don't stack allocate far too much just | ||
597 | because database might contain a large value here */ | ||
598 | GNUNET_break (0); | ||
599 | ret = GNUNET_SYSERR; | ||
600 | } | ||
594 | else | 601 | else |
595 | { | 602 | { |
596 | struct GNUNET_NAMESTORE_RecordData rd[record_count]; | 603 | struct GNUNET_NAMESTORE_RecordData rd[record_count]; |
@@ -601,7 +608,6 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
601 | { | 608 | { |
602 | GNUNET_break (0); | 609 | GNUNET_break (0); |
603 | ret = GNUNET_SYSERR; | 610 | ret = GNUNET_SYSERR; |
604 | record_count = 0; | ||
605 | } | 611 | } |
606 | else | 612 | else |
607 | { | 613 | { |