aboutsummaryrefslogtreecommitdiff
path: root/test/090_tables_readwrite
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-10-12 16:23:05 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-10-12 16:23:05 +0200
commit182e2d45678d0487be71370c37b88daca3d2c54b (patch)
tree3987ecd9bade082a7b41901c2376daa73401e548 /test/090_tables_readwrite
parentda8fdd4955fd24666643915a6728678e9965a0d3 (diff)
downloadnissy-core-182e2d45678d0487be71370c37b88daca3d2c54b.tar.gz
nissy-core-182e2d45678d0487be71370c37b88daca3d2c54b.zip
Make gendata and co safer by checking buffer size
Diffstat (limited to 'test/090_tables_readwrite')
-rw-r--r--test/090_tables_readwrite/00_table.in2
-rw-r--r--test/090_tables_readwrite/00_table.out2
-rw-r--r--test/090_tables_readwrite/tables_readwrite_tests.c8
3 files changed, 6 insertions, 6 deletions
diff --git a/test/090_tables_readwrite/00_table.in b/test/090_tables_readwrite/00_table.in
index 0423662..3c2da46 100644
--- a/test/090_tables_readwrite/00_table.in
+++ b/test/090_tables_readwrite/00_table.in
@@ -2,7 +2,7 @@ Test solver
2 2
30 30
4512 4512
5100000000000 5512
612345678912345 612345678912345
7399999999998 7399999999998
83393 83393
diff --git a/test/090_tables_readwrite/00_table.out b/test/090_tables_readwrite/00_table.out
index 0423662..3c2da46 100644
--- a/test/090_tables_readwrite/00_table.out
+++ b/test/090_tables_readwrite/00_table.out
@@ -2,7 +2,7 @@ Test solver
2 2
30 30
4512 4512
5100000000000 5512
612345678912345 612345678912345
7399999999998 7399999999998
83393 83393
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 @@
1#include "../test.h" 1#include "../test.h"
2 2
3bool readtableinfo(const void *, tableinfo_t *); 3bool readtableinfo(uint64_t, const char *, tableinfo_t *);
4bool writetableinfo(const tableinfo_t *, void *); 4bool writetableinfo(const tableinfo_t *, uint64_t, char *);
5 5
6uint64_t readn(void) { 6uint64_t readn(void) {
7 char str[STRLENMAX]; 7 char str[STRLENMAX];
@@ -70,7 +70,7 @@ void run(void) {
70 tableinfo_t expected, actual; 70 tableinfo_t expected, actual;
71 71
72 expected = test_readinfo(); 72 expected = test_readinfo();
73 writetableinfo(&expected, buf); 73 writetableinfo(&expected, INFOSIZE, buf);
74 readtableinfo(buf, &actual); 74 readtableinfo(INFOSIZE, buf, &actual);
75 test_writeinfo(actual); 75 test_writeinfo(actual);
76} 76}

Generated with cgit - Back to sebastiano.tronto.net