diff options
author | Carlo von lynX <lynX@time.to.get.psyced.org> | 2016-07-28 23:36:38 +0000 |
---|---|---|
committer | Carlo von lynX <lynX@time.to.get.psyced.org> | 2016-07-28 23:36:38 +0000 |
commit | 01a8bbfb74277d3dd7f1c0e24f7ed61554658fd6 (patch) | |
tree | e86b4b7a3344cfff9e6a6fc73bb43c53d22a61bf /src/psycstore | |
parent | 39e290e789e2eccaaf5db1201b0acc9038fa8960 (diff) | |
download | gnunet-01a8bbfb74277d3dd7f1c0e24f7ed61554658fd6.tar.gz gnunet-01a8bbfb74277d3dd7f1c0e24f7ed61554658fd6.zip |
fixed use after free and several printf warnings
Diffstat (limited to 'src/psycstore')
-rw-r--r-- | src/psycstore/test_psycstore.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/psycstore/test_psycstore.c b/src/psycstore/test_psycstore.c index f9a7ce9ca..6741858ee 100644 --- a/src/psycstore/test_psycstore.c +++ b/src/psycstore/test_psycstore.c | |||
@@ -195,7 +195,7 @@ state_result (void *cls, | |||
195 | { | 195 | { |
196 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 196 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
197 | " variable %s differs\nReceived: %.*s\nExpected: %.*s\n", | 197 | " variable %s differs\nReceived: %.*s\nExpected: %.*s\n", |
198 | name, value_size, value, val_size, val); | 198 | name, value_size, (char*) value, val_size, (char*) val); |
199 | GNUNET_assert (0); | 199 | GNUNET_assert (0); |
200 | return GNUNET_SYSERR; | 200 | return GNUNET_SYSERR; |
201 | } | 201 | } |
@@ -208,7 +208,7 @@ state_get_prefix_result (void *cls, int64_t result, | |||
208 | { | 208 | { |
209 | struct StateClosure *scls = cls; | 209 | struct StateClosure *scls = cls; |
210 | op = NULL; | 210 | op = NULL; |
211 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_get_prefix_result:\t%d\n", result); | 211 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_get_prefix_result:\t%ld\n", (long int) result); |
212 | GNUNET_assert (GNUNET_OK == result && 2 == scls->n); | 212 | GNUNET_assert (GNUNET_OK == result && 2 == scls->n); |
213 | 213 | ||
214 | op = GNUNET_PSYCSTORE_state_reset (h, &channel_pub_key, | 214 | op = GNUNET_PSYCSTORE_state_reset (h, &channel_pub_key, |
@@ -221,7 +221,7 @@ state_get_result (void *cls, int64_t result, | |||
221 | const char *err_msg, uint16_t err_msg_size) | 221 | const char *err_msg, uint16_t err_msg_size) |
222 | { | 222 | { |
223 | op = NULL; | 223 | op = NULL; |
224 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_get_result:\t%d\n", result); | 224 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_get_result:\t%ld\n", (long int) result); |
225 | GNUNET_assert (GNUNET_OK == result); | 225 | GNUNET_assert (GNUNET_OK == result); |
226 | 226 | ||
227 | scls.n = 0; | 227 | scls.n = 0; |
@@ -274,7 +274,7 @@ state_modify_result (void *cls, int64_t result, | |||
274 | const char *err_msg, uint16_t err_msg_size) | 274 | const char *err_msg, uint16_t err_msg_size) |
275 | { | 275 | { |
276 | op = NULL; | 276 | op = NULL; |
277 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_modify_result:\t%d\n", result); | 277 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_modify_result:\t%ld\n", (long int) result); |
278 | GNUNET_assert (GNUNET_OK == result); | 278 | GNUNET_assert (GNUNET_OK == result); |
279 | 279 | ||
280 | op = GNUNET_PSYCSTORE_counters_get (h, &channel_pub_key, | 280 | op = GNUNET_PSYCSTORE_counters_get (h, &channel_pub_key, |
@@ -288,7 +288,7 @@ state_sync_result (void *cls, int64_t result, | |||
288 | { | 288 | { |
289 | struct FragmentClosure *fcls = cls; | 289 | struct FragmentClosure *fcls = cls; |
290 | op = NULL; | 290 | op = NULL; |
291 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_sync_result:\t%d\n", result); | 291 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_sync_result:\t%ld\n", (long int) result); |
292 | GNUNET_assert (GNUNET_OK == result); | 292 | GNUNET_assert (GNUNET_OK == result); |
293 | 293 | ||
294 | op = GNUNET_PSYCSTORE_state_modify (h, &channel_pub_key, | 294 | op = GNUNET_PSYCSTORE_state_modify (h, &channel_pub_key, |
@@ -332,7 +332,7 @@ message_get_latest_result (void *cls, int64_t result, | |||
332 | { | 332 | { |
333 | struct FragmentClosure *fcls = cls; | 333 | struct FragmentClosure *fcls = cls; |
334 | op = NULL; | 334 | op = NULL; |
335 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "message_get_latest:\t%d\n", result); | 335 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "message_get_latest:\t%ld\n", (long int) result); |
336 | GNUNET_assert (0 < result && fcls->n == fcls->n_expected); | 336 | GNUNET_assert (0 < result && fcls->n == fcls->n_expected); |
337 | 337 | ||
338 | modifiers[0] = (struct GNUNET_PSYC_Modifier) { | 338 | modifiers[0] = (struct GNUNET_PSYC_Modifier) { |
@@ -361,7 +361,7 @@ message_get_result (void *cls, int64_t result, | |||
361 | { | 361 | { |
362 | struct FragmentClosure *fcls = cls; | 362 | struct FragmentClosure *fcls = cls; |
363 | op = NULL; | 363 | op = NULL; |
364 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "message_get:\t%d\n", result); | 364 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "message_get:\t%ld\n", (long int) result); |
365 | GNUNET_assert (0 < result && fcls->n == fcls->n_expected); | 365 | GNUNET_assert (0 < result && fcls->n == fcls->n_expected); |
366 | 366 | ||
367 | fcls->n = 0; | 367 | fcls->n = 0; |
@@ -378,7 +378,7 @@ message_get_fragment_result (void *cls, int64_t result, | |||
378 | { | 378 | { |
379 | struct FragmentClosure *fcls = cls; | 379 | struct FragmentClosure *fcls = cls; |
380 | op = NULL; | 380 | op = NULL; |
381 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "message_get_fragment:\t%d\n", result); | 381 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "message_get_fragment:\t%ld\n", (long int) result); |
382 | GNUNET_assert (0 < result && fcls->n == fcls->n_expected); | 382 | GNUNET_assert (0 < result && fcls->n == fcls->n_expected); |
383 | 383 | ||
384 | fcls->n = 0; | 384 | fcls->n = 0; |
@@ -397,7 +397,7 @@ fragment_get_latest_result (void *cls, int64_t result, | |||
397 | { | 397 | { |
398 | struct FragmentClosure *fcls = cls; | 398 | struct FragmentClosure *fcls = cls; |
399 | op = NULL; | 399 | op = NULL; |
400 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "fragment_get_latest:\t%d\n", result); | 400 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "fragment_get_latest:\t%ld\n", (long int) result); |
401 | GNUNET_assert (0 < result && fcls->n == fcls->n_expected); | 401 | GNUNET_assert (0 < result && fcls->n == fcls->n_expected); |
402 | 402 | ||
403 | fcls->n = 1; | 403 | fcls->n = 1; |
@@ -435,7 +435,7 @@ fragment_store_result (void *cls, int64_t result, | |||
435 | const char *err_msg, uint16_t err_msg_size) | 435 | const char *err_msg, uint16_t err_msg_size) |
436 | { | 436 | { |
437 | op = NULL; | 437 | op = NULL; |
438 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "fragment_store:\t%d\n", result); | 438 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "fragment_store:\t%ld\n", (long int) result); |
439 | GNUNET_assert (GNUNET_OK == result); | 439 | GNUNET_assert (GNUNET_OK == result); |
440 | 440 | ||
441 | if ((intptr_t) cls == GNUNET_YES) | 441 | if ((intptr_t) cls == GNUNET_YES) |
@@ -507,7 +507,7 @@ membership_test_result (void *cls, int64_t result, | |||
507 | const char *err_msg, uint16_t err_msg_size) | 507 | const char *err_msg, uint16_t err_msg_size) |
508 | { | 508 | { |
509 | op = NULL; | 509 | op = NULL; |
510 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "membership_test:\t%d\n", result); | 510 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "membership_test:\t%ld\n", (long int) result); |
511 | GNUNET_assert (GNUNET_OK == result); | 511 | GNUNET_assert (GNUNET_OK == result); |
512 | 512 | ||
513 | fragment_store (); | 513 | fragment_store (); |
@@ -519,7 +519,7 @@ membership_store_result (void *cls, int64_t result, | |||
519 | const char *err_msg, uint16_t err_msg_size) | 519 | const char *err_msg, uint16_t err_msg_size) |
520 | { | 520 | { |
521 | op = NULL; | 521 | op = NULL; |
522 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "membership_store:\t%d\n", result); | 522 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "membership_store:\t%ld\n", (long int) result); |
523 | GNUNET_assert (GNUNET_OK == result); | 523 | GNUNET_assert (GNUNET_OK == result); |
524 | 524 | ||
525 | op = GNUNET_PSYCSTORE_membership_test (h, &channel_pub_key, &slave_pub_key, | 525 | op = GNUNET_PSYCSTORE_membership_test (h, &channel_pub_key, &slave_pub_key, |