gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r4943 - GNUnet/src/applications/identity


From: gnunet
Subject: [GNUnet-SVN] r4943 - GNUnet/src/applications/identity
Date: Fri, 8 Jun 2007 00:18:09 -0600 (MDT)

Author: grothoff
Date: 2007-06-08 00:18:08 -0600 (Fri, 08 Jun 2007)
New Revision: 4943

Modified:
   GNUnet/src/applications/identity/identity.c
Log:
check size

Modified: GNUnet/src/applications/identity/identity.c
===================================================================
--- GNUnet/src/applications/identity/identity.c 2007-06-08 06:16:39 UTC (rev 
4942)
+++ GNUnet/src/applications/identity/identity.c 2007-06-08 06:18:08 UTC (rev 
4943)
@@ -580,12 +580,14 @@
                          fn,
                          MAX_BUFFER_SIZE,
                          buffer);
-    oldMsg = (P2P_hello_MESSAGE*) buffer;
-    if ((unsigned int)size == P2P_hello_MESSAGE_size(oldMsg)) {
-      if (ntohl(oldMsg->expirationTime) > ntohl(msg->expirationTime)) {
-       FREE(fn);
-       FREE(buffer);
-       return; /* have more recent hello in stock */
+    if (size >= sizeof(P2P_hello_MESSAGE)) {
+      oldMsg = (P2P_hello_MESSAGE*) buffer;
+      if ((unsigned int)size == P2P_hello_MESSAGE_size(oldMsg)) {
+       if (ntohl(oldMsg->expirationTime) > ntohl(msg->expirationTime)) {
+         FREE(fn);
+         FREE(buffer);
+         return; /* have more recent hello in stock */
+       }
       }
     }
   }





reply via email to

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