From 182e2d45678d0487be71370c37b88daca3d2c54b Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 12 Oct 2024 16:23:05 +0200 Subject: Make gendata and co safer by checking buffer size --- test/090_tables_readwrite/tables_readwrite_tests.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/090_tables_readwrite/tables_readwrite_tests.c') diff --git a/test/090_tables_readwrite/tables_readwrite_tests.c b/test/090_tables_readwrite/tables_readwrite_tests.c index 9238207..01c1172 100644 --- a/test/090_tables_readwrite/tables_readwrite_tests.c +++ b/test/090_tables_readwrite/tables_readwrite_tests.c @@ -1,7 +1,7 @@ #include "../test.h" -bool readtableinfo(const void *, tableinfo_t *); -bool writetableinfo(const tableinfo_t *, void *); +bool readtableinfo(uint64_t, const char *, tableinfo_t *); +bool writetableinfo(const tableinfo_t *, uint64_t, char *); uint64_t readn(void) { char str[STRLENMAX]; @@ -70,7 +70,7 @@ void run(void) { tableinfo_t expected, actual; expected = test_readinfo(); - writetableinfo(&expected, buf); - readtableinfo(buf, &actual); + writetableinfo(&expected, INFOSIZE, buf); + readtableinfo(INFOSIZE, buf, &actual); test_writeinfo(actual); } -- cgit v1.3