From 28b5e512a2487f215aac215a43d542c601c2022d Mon Sep 17 00:00:00 2001 From: iphydf Date: Thu, 13 Jan 2022 22:36:13 +0000 Subject: [PATCH] fix: Fix `toxav_basic_test` buffer overflow. We should pass the number of samples, not the byte size of `PCM`. --- .github/settings.yml | 3 +-- auto_tests/toxav_basic_test.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/settings.yml b/.github/settings.yml index 844bb061..8c5ddf9e 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -12,8 +12,7 @@ branches: protection: required_status_checks: contexts: - # TODO(iphydf): Make asan required once errors are fixed. - #- "bazel-asan" + - "bazel-asan" - "bazel-debug" - "bazel-release" - "bazel-tsan" diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index afbfc6d4..5f3b73c0 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c @@ -103,7 +103,7 @@ static void iterate_tox(Tox *bootstrap, Tox *Alice, Tox *Bob) static bool toxav_audio_send_frame_helper(ToxAV *av, uint32_t friend_number, Toxav_Err_Send_Frame *error) { static const int16_t PCM[960] = {0}; - return toxav_audio_send_frame(av, 0, PCM, sizeof(PCM), 1, 48000, nullptr); + return toxav_audio_send_frame(av, 0, PCM, 960, 1, 48000, nullptr); } static void regular_call_flow(