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

Commits on Feb 1, 2024

  1. read_api_test: fix invalid memory access

    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.
    bkueng committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    82a76f3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f90bcea View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    94f6ae0 View commit details
    Browse the repository at this point in the history
  4. messages: throw AccessException when trying to access invalid field/i…

    …ndex
    
    And check for it in the ulog_data example
    bkueng committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    f3981ec View commit details
    Browse the repository at this point in the history