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

Latest commit introduces segfault in ccsds_encoder block #14

Open
chupalt opened this issue Feb 18, 2021 · 0 comments
Open

Latest commit introduces segfault in ccsds_encoder block #14

chupalt opened this issue Feb 18, 2021 · 0 comments

Comments

@chupalt
Copy link

chupalt commented Feb 18, 2021

In particular line 129 causes you to index into an out of bounds memory region of the in array

      // copy data from input to rs block
      if (d_interleave) {
          for (uint8_t j=0; j<RS_BLOCK_LEN; j++)
              rs_block[j] = in[i + (d_n_interleave*j)];
      } else {
          memcpy(rs_block, &in[i*RS_DATA_LEN], RS_DATA_LEN);
      }

in is typically 1115 bytes (223 * 5). RS_BLOCK_LEN = 255 (223+32), so in the case of an interleaving depth of 5 there are a number of values that will be larger than 1115 (max of 255* 5 + 5= 1280). As long as nothing else is using this memory, you operate fine. If something else is using this memory or it is not accessible, you get a seg fault.

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

No branches or pull requests

1 participant