Skip to content
Snippets Groups Projects
Commit 935ba6f5 authored by Gábor Szalai's avatar Gábor Szalai
Browse files

RAW decoder overindex fix (issue #558)


Prevent the overindexing during the decoding of the last fields

Signed-off-by: default avatarGabor Szalai <gabor.szalai@ericsson.com>
parent 8fd5ec92
No related branches found
No related tags found
1 merge request!188RAW decoder overindex fix (issue #558)
...@@ -1411,6 +1411,7 @@ unsigned char TTCN_Buffer::get_byte_align(size_t len, ...@@ -1411,6 +1411,7 @@ unsigned char TTCN_Buffer::get_byte_align(size_t len,
size_t idx) size_t idx)
{ {
if(idx>(bit_pos+len)/8) return '\0'; if(idx>(bit_pos+len)/8) return '\0';
if((buf_pos+idx) >= buf_len) return '\0';
const unsigned char *data_ptr = buf_ptr != NULL ? buf_ptr->data_ptr : NULL; const unsigned char *data_ptr = buf_ptr != NULL ? buf_ptr->data_ptr : NULL;
if(idx==0){ // first byte if(idx==0){ // first byte
if(fieldorder==req_align){ if(fieldorder==req_align){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment