Skip to content

Latest commit introduces segfault in ccsds_encoder block #14

@chupalt

Description

@chupalt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions