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/peerinfo | |
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/peerinfo')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index ae8a0dfe3..a839da049 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -249,7 +249,7 @@ add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity) | |||
249 | struct HostEntry *entry; | 249 | struct HostEntry *entry; |
250 | char *fn; | 250 | char *fn; |
251 | uint32_t trust; | 251 | uint32_t trust; |
252 | char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE]; | 252 | char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; |
253 | const struct GNUNET_HELLO_Message *hello; | 253 | const struct GNUNET_HELLO_Message *hello; |
254 | struct GNUNET_HELLO_Message *hello_clean; | 254 | struct GNUNET_HELLO_Message *hello_clean; |
255 | int size; | 255 | int size; |
@@ -494,7 +494,7 @@ send_to_each_host (const struct GNUNET_PeerIdentity *only, | |||
494 | struct HostEntry *pos; | 494 | struct HostEntry *pos; |
495 | struct InfoMessage *im; | 495 | struct InfoMessage *im; |
496 | uint16_t hs; | 496 | uint16_t hs; |
497 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; | 497 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; |
498 | struct GNUNET_SERVER_TransmitContext *tc; | 498 | struct GNUNET_SERVER_TransmitContext *tc; |
499 | int match; | 499 | int match; |
500 | 500 | ||
@@ -600,7 +600,7 @@ static int | |||
600 | discard_hosts_helper (void *cls, const char *fn) | 600 | discard_hosts_helper (void *cls, const char *fn) |
601 | { | 601 | { |
602 | struct GNUNET_TIME_Absolute *now = cls; | 602 | struct GNUNET_TIME_Absolute *now = cls; |
603 | char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE]; | 603 | char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; |
604 | const struct GNUNET_HELLO_Message *hello; | 604 | const struct GNUNET_HELLO_Message *hello; |
605 | struct GNUNET_HELLO_Message *new_hello; | 605 | struct GNUNET_HELLO_Message *new_hello; |
606 | int size; | 606 | int size; |