gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9026 - GNUnet/src/applications/sqstore_mysql


From: gnunet
Subject: [GNUnet-SVN] r9026 - GNUnet/src/applications/sqstore_mysql
Date: Thu, 24 Sep 2009 07:47:47 -0600

Author: grothoff
Date: 2009-09-24 07:47:47 -0600 (Thu, 24 Sep 2009)
New Revision: 9026

Modified:
   GNUnet/src/applications/sqstore_mysql/mysql.c
Log:
fixing possible crash on corrupt DB

Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c       2009-09-24 13:21:58 UTC 
(rev 9025)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c       2009-09-24 13:47:47 UTC 
(rev 9026)
@@ -418,6 +418,11 @@
   contentSize = *(unsigned int *) result[0].buffer;
   if (contentSize < sizeof (GNUNET_DatastoreValue))
     return NULL;                /* error */
+  if (contentSize > GNUNET_MAX_BUFFER_SIZE)
+    {
+       GNUNET_GE_BREAK (NULL, 0); /* far too big */
+       return NULL;
+    }
   contentSize -= sizeof (GNUNET_DatastoreValue);
   type = *(unsigned int *) result[1].buffer;
   prio = *(unsigned int *) result[2].buffer;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]