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

Add checks for invalid fields & index bounds #9

Merged
merged 4 commits into from
Feb 2, 2024
Merged

Add checks for invalid fields & index bounds #9

merged 4 commits into from
Feb 2, 2024

Conversation

bkueng
Copy link
Member

@bkueng bkueng commented Feb 1, 2024

Fixes #8

GCC errors:
test/read_api_test.cpp: In function ‘void DOCTEST_ANON_FUNC_3()’:
test/read_api_test.cpp:104:9: error: ‘void* memcpy(void*, const void*, size_t)’ reading 17 bytes from a region of size 13 [-Werror=stringop-overread]
  104 |   memcpy(data_vector.data() + 12, &t02, 17);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/read_api_test.cpp:87:14: note: source object ‘t02’ of size 13
   87 |   const char t02[] = "Hello World!";
      |              ^~~
test/read_api_test.cpp:108:9: error: ‘void* memcpy(void*, const void*, size_t)’ reading 19 bytes from a region of size 15 [-Werror=stringop-overread]
  108 |   memcpy(data_vector.data() + 42, &t06, 19);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/read_api_test.cpp:91:14: note: source object ‘t06’ of size 15
   91 |   const char t06[] = "Hello World! 2";
      |              ^~~
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.
…ndex

And check for it in the ulog_data example
@bkueng bkueng merged commit cf24ec6 into main Feb 2, 2024
2 checks passed
@bkueng bkueng deleted the fixes branch February 2, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails with SIGSEGV
1 participant