From ff7b4f84187e28c83ed7d995ec8f2f475faa460f Mon Sep 17 00:00:00 2001 From: Aaron Lipinski Date: Fri, 16 Aug 2013 00:03:47 +1200 Subject: [PATCH 1/2] Add spam length to data length in comparison against max size --- core/friend_requests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/friend_requests.c b/core/friend_requests.c index ae19ebdd..0de2b498 100644 --- a/core/friend_requests.c +++ b/core/friend_requests.c @@ -33,7 +33,7 @@ uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; return the number of peers it was routed through if it did not send it directly.*/ int send_friendrequest(uint8_t * public_key, uint32_t nospam_num, uint8_t * data, uint32_t length) { - if(length - sizeof(nospam_num) > MAX_DATA_SIZE) + if(length + sizeof(nospam_num) > MAX_DATA_SIZE) return -1; uint8_t temp[MAX_DATA_SIZE]; From 487c7d27d504ae248b600d56b76b7b9074e40ebe Mon Sep 17 00:00:00 2001 From: naxuroqa Date: Fri, 16 Aug 2013 09:40:53 +0200 Subject: [PATCH 2/2] Fix for issue 472 --- CMakeLists.txt | 2 +- cmake/FindSODIUM.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86b5d27b..815616a7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ else() include_directories(${SODIUM_INCLUDE_DIR}) - set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARY}) + set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARIES}) endif() #MinGW prints more warnings for -Wall than gcc does, thus causing build to fail diff --git a/cmake/FindSODIUM.cmake b/cmake/FindSODIUM.cmake index 2db0f667..6b0c2f23 100644 --- a/cmake/FindSODIUM.cmake +++ b/cmake/FindSODIUM.cmake @@ -54,8 +54,8 @@ endif() find_library(SODIUM_LIBRARY NAMES - ${WIN32_LIBSODIUM_FILENAME} sodium + ${WIN32_LIBSODIUM_FILENAME} PATHS ${SODIUM_ROOT_DIR}/lib )