Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the size of a save file in file_saving_test. #1089

Merged
merged 1 commit into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ matrix:
- libcv-dev # For av_test.
- libhighgui-dev # For av_test.
- libopencv-contrib-dev # For av_test.
- libsndfile1-dev # For av_test.
- portaudio19-dev # For av_test.
before_install:
# Clear bazel installation.
- rm -rf $HOME/.cache/bazel/_bazel_$USER/install
Expand Down
5 changes: 3 additions & 2 deletions auto_tests/file_saving_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "config.h"
#endif

#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -82,12 +83,12 @@ static void load_data_decrypted(void)
int64_t size = ftell(f);
fseek(f, 0, SEEK_SET);

ck_assert_msg(0 <= size && size <= SIZE_MAX, "file size out of range");
ck_assert_msg(0 <= size && size <= UINT_MAX, "file size out of range");

uint8_t *cipher = (uint8_t *)malloc(size);
uint8_t *clear = (uint8_t *)malloc(size - TOX_PASS_ENCRYPTION_EXTRA_LENGTH);
size_t read_value = fread(cipher, sizeof(*cipher), size, f);
printf("Read read_vavue = %u of %lu\n", (unsigned)read_value, (unsigned long)size);
printf("Read read_value = %u of %u\n", (unsigned)read_value, (unsigned)size);

TOX_ERR_DECRYPTION derr;

Expand Down
2 changes: 1 addition & 1 deletion toxav/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ cc_library(
srcs = ["groupav.c"],
hdrs = ["groupav.h"],
deps = [
"//c-toxcore/toxcore:toxcore",
"//c-toxcore/toxcore",
"@opus",
],
)
Expand Down