diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2015-08-03 15:39:05 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2015-08-03 15:39:05 +0000 |
commit | 9cbdef2552dc31d4faf71f5dc961f27f3a99d559 (patch) | |
tree | 0c4e15526d493ef2d51b9a9569bd14615d8ef939 /src/rps/rps_api.c | |
parent | 937b425c919c45cf15c633da83777341a300ecf2 (diff) | |
download | gnunet-9cbdef2552dc31d4faf71f5dc961f27f3a99d559.tar.gz gnunet-9cbdef2552dc31d4faf71f5dc961f27f3a99d559.zip |
- check for uint32 value overflow
Diffstat (limited to 'src/rps/rps_api.c')
-rw-r--r-- | src/rps/rps_api.c | 13 |
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 | |||
65 | struct GNUNET_RPS_Handle *rps_handle; | 65 | struct GNUNET_RPS_Handle *rps_handle; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * The id of the request. | ||
69 | */ | ||
70 | uint32_t id; | ||
71 | |||
72 | /** | ||
73 | * The callback to be called when we receive an answer. | 68 | * The callback to be called when we receive an answer. |
74 | */ | 69 | */ |
75 | GNUNET_RPS_NotifyReadyCB ready_cb; | 70 | GNUNET_RPS_NotifyReadyCB ready_cb; |
@@ -78,6 +73,11 @@ struct GNUNET_RPS_Request_Handle | |||
78 | * The closure for the callback. | 73 | * The closure for the callback. |
79 | */ | 74 | */ |
80 | void *ready_cb_cls; | 75 | void *ready_cb_cls; |
76 | |||
77 | /** | ||
78 | * The id of the request. | ||
79 | */ | ||
80 | uint32_t id; | ||
81 | }; | 81 | }; |
82 | 82 | ||
83 | 83 | ||
@@ -237,7 +237,8 @@ GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *rps_handle, | |||
237 | // assert func != NULL | 237 | // assert func != NULL |
238 | rh = GNUNET_new (struct GNUNET_RPS_Request_Handle); | 238 | rh = GNUNET_new (struct GNUNET_RPS_Request_Handle); |
239 | rh->rps_handle = rps_handle; | 239 | rh->rps_handle = rps_handle; |
240 | rh->id = req_handlers_size; // TODO ntoh | 240 | GNUNET_assert (req_handlers_size < UINT32_MAX); |
241 | rh->id = (uint32_t) req_handlers_size; | ||
241 | rh->ready_cb = ready_cb; | 242 | rh->ready_cb = ready_cb; |
242 | rh->ready_cb_cls = cls; | 243 | rh->ready_cb_cls = cls; |
243 | 244 | ||