gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36192 - gnunet/src/rps


From: gnunet
Subject: [GNUnet-SVN] r36192 - gnunet/src/rps
Date: Mon, 3 Aug 2015 17:39:05 +0200

Author: harsha
Date: 2015-08-03 17:39:05 +0200 (Mon, 03 Aug 2015)
New Revision: 36192

Modified:
   gnunet/src/rps/rps_api.c
Log:
- check for uint32 value overflow

Modified: gnunet/src/rps/rps_api.c
===================================================================
--- gnunet/src/rps/rps_api.c    2015-08-03 14:30:15 UTC (rev 36191)
+++ gnunet/src/rps/rps_api.c    2015-08-03 15:39:05 UTC (rev 36192)
@@ -65,11 +65,6 @@
   struct GNUNET_RPS_Handle *rps_handle;
 
   /**
-   * The id of the request.
-   */
-  uint32_t id;
-
-  /**
    * The callback to be called when we receive an answer.
    */
   GNUNET_RPS_NotifyReadyCB ready_cb;
@@ -78,6 +73,11 @@
    * The closure for the callback.
    */
   void *ready_cb_cls;
+
+  /**
+   * The id of the request.
+   */
+  uint32_t id;
 };
 
 
@@ -237,7 +237,8 @@
   // assert func != NULL
   rh = GNUNET_new (struct GNUNET_RPS_Request_Handle);
   rh->rps_handle = rps_handle;
-  rh->id = req_handlers_size; // TODO ntoh
+  GNUNET_assert (req_handlers_size < UINT32_MAX);
+  rh->id = (uint32_t) req_handlers_size;
   rh->ready_cb = ready_cb;
   rh->ready_cb_cls = cls;
 




reply via email to

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