diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-04 09:28:35 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-04 09:28:35 -0500 |
commit | 6e4c1b84adae268691de27a204ecd8beabd753e6 (patch) | |
tree | db782804b5211434ff861db97a881f9eafc852bb | |
parent | 2372e40c40ef7bc85176d8998272ad75a59fcf05 (diff) | |
download | stasis-6e4c1b84adae268691de27a204ecd8beabd753e6.tar.gz |
Fix invalid write in mock_data
-rw-r--r-- | tests/test_copy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_copy.c b/tests/test_copy.c index 14310e4..b37b1d3 100644 --- a/tests/test_copy.c +++ b/tests/test_copy.c @@ -18,7 +18,7 @@ void test_copy() { for (size_t i = 0; i < sizeof(tc) / sizeof(*tc); i++) { struct stat st_a, st_b; struct testcase *test = &tc[i]; - char *mock_data = malloc(test->expect_size * sizeof(*mock_data)); + char *mock_data = malloc(test->expect_size + 1 * sizeof(*mock_data)); memset(mock_data, 'A', test->expect_size); mock_data[test->expect_size] = '\0'; stasis_testing_write_ascii(test->in_file, mock_data); |