aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-09-19 14:35:32 +0200
committerTheJackiMonster <thejackimonster@gmail.com>2022-09-19 14:35:32 +0200
commitd9a0342d77f4489e56678d9a8e6afc9e25d8163d (patch)
tree0089e5932c403182625d5bd7b2ef15293939db95
parent53f4571b0417080dcf13e26e2f32686cc9326a5d (diff)
downloadgnunet-d9a0342d77f4489e56678d9a8e6afc9e25d8163d.tar.gz
gnunet-d9a0342d77f4489e56678d9a8e6afc9e25d8163d.zip
-fix fs index_start_failed
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--src/fs/fs_publish.c2
-rw-r--r--src/fs/gnunet-service-fs.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index f891f37a1..5cdf8f6e8 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -699,7 +699,7 @@ check_index_start_failed (void *cls,
699 size_t msize = ntohs (msg->size) - sizeof(*msg); 699 size_t msize = ntohs (msg->size) - sizeof(*msg);
700 const char *emsg = (const char *) &msg[1]; 700 const char *emsg = (const char *) &msg[1];
701 701
702 if (emsg[msize - sizeof(struct GNUNET_MessageHeader) - 1] != '\0') 702 if (emsg[msize - 1] != '\0')
703 { 703 {
704 GNUNET_break (0); 704 GNUNET_break (0);
705 return GNUNET_SYSERR; 705 return GNUNET_SYSERR;
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 05c7e2192..c22a5b5a9 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -1041,8 +1041,14 @@ hash_for_index_val (void *cls,
1041 "Hash mismatch trying to index file `%s' which does not have hash `%s'\n"), 1041 "Hash mismatch trying to index file `%s' which does not have hash `%s'\n"),
1042 isc->filename, 1042 isc->filename,
1043 GNUNET_h2s (&isc->file_id)); 1043 GNUNET_h2s (&isc->file_id));
1044 env = GNUNET_MQ_msg (msg, 1044
1045 GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED); 1045 const char *emsg = "hash mismatch";
1046 const size_t msize = strlen(emsg) + 1;
1047
1048 env = GNUNET_MQ_msg_extra (msg,
1049 msize,
1050 GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED);
1051 memcpy((char*) &msg[1], emsg, msize);
1046 GNUNET_MQ_send (lc->mq, 1052 GNUNET_MQ_send (lc->mq,
1047 env); 1053 env);
1048 GNUNET_SERVICE_client_continue (lc->client); 1054 GNUNET_SERVICE_client_continue (lc->client);