From 36dfea3b5ede67bb824029c8e9bcad764a4b9ef8 Mon Sep 17 00:00:00 2001 From: ABrambleNinja Date: Thu, 15 Aug 2013 04:07:43 +0000 Subject: [PATCH 1/3] For me, installing check wasn't enough. check-devel was required (Fedora 19) --- INSTALL.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 1ee1c66f..3d01d562 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -23,7 +23,7 @@ On Fedora: ```bash yum groupinstall "Development Tools" -yum install libtool autoconf automake libconfig-devel ncurses-devel cmake check +yum install libtool autoconf automake libconfig-devel ncurses-devel cmake check check-devel ``` Note that `libconfig-dev` should be >= 1.4. @@ -61,8 +61,8 @@ mkdir build && cd build cmake .. ``` Advance cmake options: - - `-DSHARED_TOXCORE=ON` (default `OFF`) — Build Core as a shared library. - - `-DUSE_NACL=ON` (default `OFF`) — Use NaCl library instead of libsodium. + - `-DSHARED_TOXCORE=ON` (default `OFF`) � Build Core as a shared library. + - `-DUSE_NACL=ON` (default `OFF`) � Use NaCl library instead of libsodium. Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only. @@ -150,8 +150,8 @@ mkdir build && cd build cmake -G "MinGW Makefiles" .. ``` Advance cmake options: - - `-DSHARED_TOXCORE=ON` (default OFF) — Build Core as a shared library. - - `-DSHARED_LIBSODIUM=ON` (default OFF) — Link libsodium as a shared library. + - `-DSHARED_TOXCORE=ON` (default OFF) � Build Core as a shared library. + - `-DSHARED_LIBSODIUM=ON` (default OFF) � Link libsodium as a shared library. Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only. From 8a56f9cb37a8bd24ffee15f5540db8d0060314ae Mon Sep 17 00:00:00 2001 From: Javier Maldonado Date: Thu, 15 Aug 2013 05:31:08 +0000 Subject: [PATCH 2/3] Added new server --- other/DHTservers | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/other/DHTservers b/other/DHTservers index 560c29b5..6efba882 100644 --- a/other/DHTservers +++ b/other/DHTservers @@ -3,4 +3,5 @@ 192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143 192.210.149.121 33445 F404ABAA1C99A9D37D61AB54898F56793E1DEF8BD46B1038B9D822E8460FAB67 81.224.34.47 443 48F0D94C0D54EB1995A2ECEDE7DB6BDD5E05D81704B2F3D1BB9FE43AC97B7269 -198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854 \ No newline at end of file +198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854 +95.47.140.214 33445 F4BF7C5A9D0EF4CB684090C38DE937FAE1612021F21FEA4DCBFAC6AAFEF58E68 From 3590f0a521812cc2d76e344c53640f8b823ac4d0 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Thu, 15 Aug 2013 15:34:27 +0200 Subject: [PATCH 3/3] Check return value of realloc_friendlist and return FAERR_NOMEM on error --- core/Messenger.c | 11 ++++++++--- core/Messenger.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/Messenger.c b/core/Messenger.c index 690a81b1..bed59d4d 100644 --- a/core/Messenger.c +++ b/core/Messenger.c @@ -120,6 +120,7 @@ void getaddress(Messenger *m, uint8_t *address) * return FAERR_BADCHECKSUM if bad checksum in address * return FAERR_SETNEWNOSPAM if the friend was already there but the nospam was different * (the nospam for that friend was set to the new one) + * return FAERR_NOMEM if increasing the friend list size fails */ int m_addfriend(Messenger *m, uint8_t *address, uint8_t *data, uint16_t length) { @@ -148,7 +149,8 @@ int m_addfriend(Messenger *m, uint8_t *address, uint8_t *data, uint16_t length) } /* resize the friend list if necessary */ - realloc_friendlist(m, m->numfriends + 1); + if (realloc_friendlist(m, m->numfriends + 1) != 0) + return FAERR_NOMEM; uint32_t i; for (i = 0; i <= m->numfriends; ++i) { @@ -180,7 +182,8 @@ int m_addfriend_norequest(Messenger *m, uint8_t * client_id) return -1; /* resize the friend list if necessary */ - realloc_friendlist(m, m->numfriends + 1); + if (realloc_friendlist(m, m->numfriends + 1) != 0) + return FAERR_NOMEM; uint32_t i; for (i = 0; i <= m->numfriends; ++i) { @@ -221,7 +224,9 @@ int m_delfriend(Messenger *m, int friendnumber) break; } m->numfriends = i; - realloc_friendlist(m, m->numfriends + 1); + + if (realloc_friendlist(m, m->numfriends + 1) != 0) + return FAERR_NOMEM; return 0; } diff --git a/core/Messenger.h b/core/Messenger.h index a2add19d..a7e0aab5 100644 --- a/core/Messenger.h +++ b/core/Messenger.h @@ -63,6 +63,7 @@ extern "C" { #define FAERR_UNKNOWN -5 #define FAERR_BADCHECKSUM -6 #define FAERR_SETNEWNOSPAM -7 +#define FAERR_NOMEM -8 /* don't assume MAX_STATUSMESSAGE_LENGTH will stay at 128, it may be increased to an absurdly large number later */