summaryrefslogtreecommitdiff
path: root/src/rps/rps_api.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2015-08-03 15:39:05 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2015-08-03 15:39:05 +0000
commit9cbdef2552dc31d4faf71f5dc961f27f3a99d559 (patch)
tree0c4e15526d493ef2d51b9a9569bd14615d8ef939 /src/rps/rps_api.c
parent937b425c919c45cf15c633da83777341a300ecf2 (diff)
- check for uint32 value overflow
Diffstat (limited to 'src/rps/rps_api.c')
-rw-r--r--src/rps/rps_api.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rps/rps_api.c b/src/rps/rps_api.c
index e06f73b9c..1993ca8b8 100644
--- a/src/rps/rps_api.c
+++ b/src/rps/rps_api.c
@@ -65,11 +65,6 @@ struct GNUNET_RPS_Request_Handle
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 @@ struct GNUNET_RPS_Request_Handle
* The closure for the callback.
*/
void *ready_cb_cls;
+
+ /**
+ * The id of the request.
+ */
+ uint32_t id;
};
@@ -237,7 +237,8 @@ GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *rps_handle,
// 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;