libschc icon indicating copy to clipboard operation
libschc copied to clipboard

Segmentation Fault in function mbuf_sort

Open FoyetFan opened this issue 2 years ago • 1 comments

When data packets need to be sorted, segment errors will be triggered in function mbuf_sort. I think it should be like this, and it does work.

mbuf_sort(){
...
if ((*next)->frag_cnt < (*curr)->frag_cnt) 
{ 
    // swap pointers for curr and curr->next 
    schc_mbuf_t *temp; 
    temp = *curr; 
    *curr = *next; 
   *next = temp; 

    temp = (*curr)->next; 
    (*curr)->next = (*next)->next;
    (*next)->next = temp;
    curr = &(*curr)->next; swapped = 1; 
}
...
}

FoyetFan avatar Jul 29 '23 09:07 FoyetFan

Could you give more information when this happens?

bartmoons avatar Jul 29 '23 12:07 bartmoons