diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-25 21:08:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-25 21:08:55 +0000 |
commit | 537903a8dc4c3ecf2dfa382af0289ddf890adfc7 (patch) | |
tree | 93e448c15c843861bd5dfe86c7cad3245abedfe7 /src/fs/gnunet-service-fs_indexing.c | |
parent | 2b61888a0bf1d41b2b25256ca9834c3040551ce9 (diff) | |
download | gnunet-537903a8dc4c3ecf2dfa382af0289ddf890adfc7.tar.gz gnunet-537903a8dc4c3ecf2dfa382af0289ddf890adfc7.zip |
fixing common off-by-one error with respect to maximum message size
Diffstat (limited to 'src/fs/gnunet-service-fs_indexing.c')
-rw-r--r-- | src/fs/gnunet-service-fs_indexing.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c index d6654bcdc..b72c53fc0 100644 --- a/src/fs/gnunet-service-fs_indexing.c +++ b/src/fs/gnunet-service-fs_indexing.c | |||
@@ -430,7 +430,7 @@ GNUNET_FS_handle_index_list_get (void *cls, | |||
430 | { | 430 | { |
431 | struct GNUNET_SERVER_TransmitContext *tc; | 431 | struct GNUNET_SERVER_TransmitContext *tc; |
432 | struct IndexInfoMessage *iim; | 432 | struct IndexInfoMessage *iim; |
433 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; | 433 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; |
434 | size_t slen; | 434 | size_t slen; |
435 | const char *fn; | 435 | const char *fn; |
436 | struct IndexInfo *pos; | 436 | struct IndexInfo *pos; |
@@ -442,8 +442,7 @@ GNUNET_FS_handle_index_list_get (void *cls, | |||
442 | { | 442 | { |
443 | fn = pos->filename; | 443 | fn = pos->filename; |
444 | slen = strlen (fn) + 1; | 444 | slen = strlen (fn) + 1; |
445 | if (slen + sizeof (struct IndexInfoMessage) > | 445 | if (slen + sizeof (struct IndexInfoMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) |
446 | GNUNET_SERVER_MAX_MESSAGE_SIZE) | ||
447 | { | 446 | { |
448 | GNUNET_break (0); | 447 | GNUNET_break (0); |
449 | break; | 448 | break; |