check
authorChristian Grothoff <christian@grothoff.org>
Fri, 25 Jun 2010 17:09:22 +0000 (17:09 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 25 Jun 2010 17:09:22 +0000 (17:09 +0000)
src/fs/fs_uri.c

index f2c291784a5ce2c0f5c3e66e079783362e146c19..8f9fbba65b8ab844467ed4d7828f571581142804 100644 (file)
@@ -1091,8 +1091,13 @@ GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri)
   switch (ret->type)
     {
     case ksk:
+      if (ret->data.ksk.keywordCount >= GNUNET_MAX_MALLOC_CHECKED / sizeof (char*))
+       {
+         GNUNET_break (0);
+         return NULL;
+       }
       if (ret->data.ksk.keywordCount > 0)
-        {
+        {        
           ret->data.ksk.keywords
             = GNUNET_malloc (ret->data.ksk.keywordCount * sizeof (char *));
           for (i = 0; i < ret->data.ksk.keywordCount; i++)