gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11029 - in gnunet/src: peerinfo util


From: gnunet
Subject: [GNUnet-SVN] r11029 - in gnunet/src: peerinfo util
Date: Thu, 22 Apr 2010 13:25:49 +0200

Author: grothoff
Date: 2010-04-22 13:25:49 +0200 (Thu, 22 Apr 2010)
New Revision: 11029

Modified:
   gnunet/src/peerinfo/gnunet-service-peerinfo.c
   gnunet/src/util/container_meta_data.c
Log:
make clang static analysis happy

Modified: gnunet/src/peerinfo/gnunet-service-peerinfo.c
===================================================================
--- gnunet/src/peerinfo/gnunet-service-peerinfo.c       2010-04-22 11:18:48 UTC 
(rev 11028)
+++ gnunet/src/peerinfo/gnunet-service-peerinfo.c       2010-04-22 11:25:49 UTC 
(rev 11029)
@@ -131,7 +131,8 @@
   im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO);
   im->trust = htonl (he->trust);
   im->peer = he->identity;
-  memcpy (&im[1], he->hello, hs);
+  if (he->hello != NULL)
+    memcpy (&im[1], he->hello, hs);
   return im;
 }
 

Modified: gnunet/src/util/container_meta_data.c
===================================================================
--- gnunet/src/util/container_meta_data.c       2010-04-22 11:18:48 UTC (rev 
11028)
+++ gnunet/src/util/container_meta_data.c       2010-04-22 11:25:49 UTC (rev 
11029)
@@ -869,8 +869,9 @@
   clen = 0;
   cdata = NULL;
   left = size;
+  i = 0;
   pos = md->items;
-  for (i=0;i<md->item_count;i++)
+  while (pos != NULL)
     {           
       comp = GNUNET_NO;
       if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS))       
@@ -967,6 +968,7 @@
       if (pos->mime_type != NULL)
        left -= strlen (pos->mime_type) + 1;
       pos = pos->next;
+      i++;
     }
   GNUNET_free (ent);
 





reply via email to

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