toxcore/toxcore
jfreegman 6b6718e4d2
cleanup: Make group packet entry creation less error-prone
We always assumed that create_array_entry() would only be called
with an empty array entry and wouldn't modify entries on error.
We now explicitly require both conditions, and also give an
error in the case of a non-null data pointer with a zero
length field, as this indicates a logic error.

Checks for an empty array entry that precede a call to
create_array_entry() are now redundant. It should be noted that
a non-empty entry doesn't necessarily indicate an error. This
condition can be triggered if packets are being sent or
received faster than they can be processed/acknowledged,
which is common when spamming messages on poor connections.
2024-01-11 11:02:29 -05:00
..
events refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
announce.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
announce.h refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
attributes.h fix: Enable debug flag for ubsan. 2023-12-09 01:14:53 +00:00
bin_pack_test.cc refactor: Protect array unpacking against invalid lengths. 2022-04-05 20:52:47 +00:00
bin_pack.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
bin_pack.h refactor: Use Bin_Pack for packing Node_format. 2023-12-04 17:36:09 +00:00
bin_unpack.c refactor: Add a bin_unpack_bin_max for max-length arrays. 2023-11-12 00:57:44 +00:00
bin_unpack.h refactor: Add a bin_unpack_bin_max for max-length arrays. 2023-11-12 00:57:44 +00:00
BUILD.bazel cleanup: Some more test cleanups, removing overly smart code. 2024-01-10 12:42:37 +00:00
ccompat.c cleanup: Make TCP connection failures a warning instead of error. 2023-12-27 02:08:09 +00:00
ccompat.h test: Add more functionality to the bootstrap harness. 2022-04-07 20:17:56 +00:00
crypto_core_test_util.cc refactor(test): Slightly nicer C++ interface to tox Random. 2024-01-10 21:56:34 +00:00
crypto_core_test_util.hh refactor(test): Slightly nicer C++ interface to tox Random. 2024-01-10 21:56:34 +00:00
crypto_core_test.cc test: Add more unit tests for add_to_list. 2024-01-10 02:58:13 +00:00
crypto_core.c cleanup: Remove NaCl support. 2023-12-25 00:36:38 +00:00
crypto_core.h cleanup: Remove NaCl support. 2023-12-25 00:36:38 +00:00
DHT_fuzz_test.cc refactor: Use Bin_Pack for packing Node_format. 2023-12-04 17:36:09 +00:00
DHT_test_util.cc refactor: Use operator== for equality tests of Node_format. 2024-01-11 13:32:01 +00:00
DHT_test_util.hh cleanup: Some more test cleanups, removing overly smart code. 2024-01-10 12:42:37 +00:00
DHT_test.cc cleanup: Some more test cleanups, removing overly smart code. 2024-01-10 12:42:37 +00:00
DHT.c refactor: Minor refactoring of get_close_nodes functions. 2024-01-10 20:12:04 +00:00
DHT.h refactor: Minor refactoring of get_close_nodes functions. 2024-01-10 20:12:04 +00:00
forwarding_fuzz_test.cc cleanup: Some more test cleanups, removing overly smart code. 2024-01-10 12:42:37 +00:00
forwarding.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
forwarding.h test: Upgrade cppcheck, fix some warnings. 2023-12-27 00:00:10 +00:00
friend_connection_test.cc chore: Add a .clang-format that mostly agrees with astyle. 2022-02-21 16:16:16 +00:00
friend_connection.c cleanup: Move all vptr-to-ptr casts to the beginning of a function. 2023-12-30 01:45:23 +00:00
friend_connection.h cleanup: Make *_free functions nullable. 2022-04-02 21:28:26 +00:00
friend_requests.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
friend_requests.h cleanup: Make *_free functions nullable. 2022-04-02 21:28:26 +00:00
group_announce_fuzz_test.cc refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
group_announce_test.cc chore: Simplify msvc build using vcpkg. 2024-01-06 12:27:31 +00:00
group_announce.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
group_announce.h cleanup: Run clang-tidy on headers, as well. 2023-12-27 02:37:39 +00:00
group_chats.c refactor: packet broadcast functions now return errors 2024-01-11 10:06:46 -05:00
group_chats.h refactor: packet broadcast functions now return errors 2024-01-11 10:06:46 -05:00
group_common.h cleanup: Run clang-tidy on headers, as well. 2023-12-27 02:37:39 +00:00
group_connection.c cleanup: Make group packet entry creation less error-prone 2024-01-11 11:02:29 -05:00
group_connection.h cleanup: Run clang-tidy on headers, as well. 2023-12-27 02:37:39 +00:00
group_moderation_fuzz_test.cc refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
group_moderation_test.cc chore: Simplify msvc build using vcpkg. 2024-01-06 12:27:31 +00:00
group_moderation.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
group_moderation.h refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
group_onion_announce.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
group_onion_announce.h Merge the remainder of the new groupchats implementation 2022-09-22 11:16:08 -04:00
group_pack.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
group_pack.h cleanup: Run clang-tidy on headers, as well. 2023-12-27 02:37:39 +00:00
group.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
group.h cleanup: Make *_free functions nullable. 2022-04-02 21:28:26 +00:00
LAN_discovery.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
LAN_discovery.h Merge the remainder of the new groupchats implementation 2022-09-22 11:16:08 -04:00
list_test.cc chore: Add a .clang-format that mostly agrees with astyle. 2022-02-21 16:16:16 +00:00
list.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
list.h cleanup: Make *_free functions nullable. 2022-04-02 21:28:26 +00:00
logger.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
logger.h perf: Slightly reduce bandwidth usage when there are few nodes. 2023-12-18 16:23:45 +00:00
Makefile.inc cleanup: Remove NaCl support. 2023-12-25 00:36:38 +00:00
mem_test.cc refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
mem.c refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
mem.h refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
Messenger.c cleanup: Move all vptr-to-ptr casts to the beginning of a function. 2023-12-30 01:45:23 +00:00
Messenger.h test: Upgrade cppcheck, fix some warnings. 2023-12-27 00:00:10 +00:00
mono_time_test.cc fix: Use QueryPerformanceCounter on windows for monotonic time. 2023-12-27 12:21:33 +00:00
mono_time.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
mono_time.h refactor: Store time in Mono_Time in milliseconds. 2023-11-17 05:20:29 +00:00
net_crypto.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
net_crypto.h refactor: Change all enum-like #define sequences into enums. 2023-12-21 08:55:51 +00:00
network_test_util.cc refactor: Use operator== for equality tests of Node_format. 2024-01-11 13:32:01 +00:00
network_test_util.hh refactor: Use operator== for equality tests of Node_format. 2024-01-11 13:32:01 +00:00
network_test.cc chore: Support producing shared libraries on Windows 2022-04-03 23:04:11 +02:00
network.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
network.h chore: Simplify msvc build using vcpkg. 2024-01-06 12:27:31 +00:00
onion_announce.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
onion_announce.h perf: Slightly reduce bandwidth usage when there are few nodes. 2023-12-18 16:23:45 +00:00
onion_client.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
onion_client.h cleanup: Run clang-tidy on headers, as well. 2023-12-27 02:37:39 +00:00
onion.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
onion.h perf: Slightly reduce bandwidth usage when there are few nodes. 2023-12-18 16:23:45 +00:00
ping_array_test.cc refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
ping_array.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
ping_array.h refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
ping.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
ping.h refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
shared_key_cache.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
shared_key_cache.h perf: Slightly reduce bandwidth usage when there are few nodes. 2023-12-18 16:23:45 +00:00
state.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
state.h Merge the remainder of the new groupchats implementation 2022-09-22 11:16:08 -04:00
TCP_client.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
TCP_client.h cleanup: Enforce stricter identifier naming using clang-tidy. 2023-08-31 13:37:16 +00:00
TCP_common.c refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
TCP_common.h refactor: Change the TCP_PACKET_* defines into an enum. 2023-12-20 15:11:23 +00:00
TCP_connection_test.cc merge tcp_connection changes from new groupchats fork 2021-12-14 16:57:28 -05:00
TCP_connection.c test: Add "infer" CI check to github, remove from circle. 2024-01-09 10:59:53 +00:00
TCP_connection.h perf: Slightly reduce bandwidth usage when there are few nodes. 2023-12-18 16:23:45 +00:00
TCP_server.c refactor: Minor refactoring of get_close_nodes functions. 2024-01-10 20:12:04 +00:00
TCP_server.h cleanup: Enforce stricter identifier naming using clang-tidy. 2023-08-31 13:37:16 +00:00
test_util_test.cc test: Add more unit tests for add_to_list. 2024-01-10 02:58:13 +00:00
test_util.cc test: Add more unit tests for add_to_list. 2024-01-10 02:58:13 +00:00
test_util.hh refactor(test): Slightly nicer C++ interface to tox Random. 2024-01-10 21:56:34 +00:00
timed_auth.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
timed_auth.h feat: add forwarding and announce request handling 2022-04-03 00:00:08 +00:00
tox_api.c refactor: packet broadcast functions now return errors 2024-01-11 10:06:46 -05:00
tox_dispatch.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
tox_dispatch.h feat: Add async event handling (callbacks) code. 2022-02-06 17:28:28 +00:00
tox_events_fuzz_test.cc refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
tox_events_test.cc refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
tox_events.c cleanup: Move all vptr-to-ptr casts to the beginning of a function. 2023-12-30 01:45:23 +00:00
tox_events.h refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
tox_private.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
tox_private.h cleanup: Move tox_get_system out of the public API. 2024-01-05 19:29:59 +00:00
tox_struct.h refactor: Add mem module to allow tests to override allocators. 2023-08-30 22:55:05 +00:00
tox_test.cc fix: Correct a use-after-free and fix some memory leaks. 2023-12-21 17:17:51 +00:00
tox_unpack.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
tox_unpack.h refactor: Use enum-from-int rule from tokstyle. 2023-12-19 20:53:15 +00:00
tox.c refactor: packet broadcast functions now return errors 2024-01-11 10:06:46 -05:00
tox.h refactor: packet broadcast functions now return errors 2024-01-11 10:06:46 -05:00
util_test.cc feat: Add support for custom random number generator. 2022-04-01 14:06:05 +00:00
util.c cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
util.h perf: Slightly reduce bandwidth usage when there are few nodes. 2023-12-18 16:23:45 +00:00