diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-01-06 21:05:03 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-01-06 21:05:03 +0100 |
commit | 8dea30580ceaa571c9d85b5e8a563201ed622ed7 (patch) | |
tree | 97cabce64f3d7c87672fad8d3ab8783ac2760187 /src/fs/fs_search.c | |
parent | 3a18658cf9196ecd8e55d5231818e6ee3b242a43 (diff) | |
download | gnunet-8dea30580ceaa571c9d85b5e8a563201ed622ed7.tar.gz gnunet-8dea30580ceaa571c9d85b5e8a563201ed622ed7.zip |
fix potential use of uninitialized key
Diffstat (limited to 'src/fs/fs_search.c')
-rw-r--r-- | src/fs/fs_search.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 8c6f5edcf..83aae2fc5 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -568,7 +568,13 @@ process_ksk_result (struct GNUNET_FS_SearchContext *sc, | |||
568 | 568 | ||
569 | /* check if new */ | 569 | /* check if new */ |
570 | GNUNET_assert (NULL != sc); | 570 | GNUNET_assert (NULL != sc); |
571 | GNUNET_FS_uri_to_key (uri, &key); | 571 | if (GNUNET_OK != |
572 | GNUNET_FS_uri_to_key (uri, | ||
573 | &key)) | ||
574 | { | ||
575 | GNUNET_break_op (0); | ||
576 | return; | ||
577 | } | ||
572 | if (GNUNET_SYSERR == | 578 | if (GNUNET_SYSERR == |
573 | GNUNET_CONTAINER_multihashmap_get_multiple (ent->results, | 579 | GNUNET_CONTAINER_multihashmap_get_multiple (ent->results, |
574 | &key, | 580 | &key, |
@@ -680,8 +686,15 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, | |||
680 | 686 | ||
681 | /* check if new */ | 687 | /* check if new */ |
682 | GNUNET_assert (NULL != sc); | 688 | GNUNET_assert (NULL != sc); |
683 | GNUNET_FS_uri_to_key (uri, &key); | 689 | if (GNUNET_OK != |
684 | GNUNET_CRYPTO_hash_xor (&uri->data.chk.chk.key, &uri->data.chk.chk.query, | 690 | GNUNET_FS_uri_to_key (uri, |
691 | &key)) | ||
692 | { | ||
693 | GNUNET_break (0); | ||
694 | return; | ||
695 | } | ||
696 | GNUNET_CRYPTO_hash_xor (&uri->data.chk.chk.key, | ||
697 | &uri->data.chk.chk.query, | ||
685 | &key); | 698 | &key); |
686 | if (GNUNET_SYSERR == | 699 | if (GNUNET_SYSERR == |
687 | GNUNET_CONTAINER_multihashmap_get_multiple (sc->master_result_map, &key, | 700 | GNUNET_CONTAINER_multihashmap_get_multiple (sc->master_result_map, &key, |