mirror of https://github.com/OISF/suricata
ftp: free the response code as a boxed slice
parse_response_line allocates the code buffer with Box::into_raw on a boxed slice, but SCFTPFreeResponseLine released it by rebuilding a Vec<u8> with capacity code_length. Vec::from_raw_parts accepts any global-allocator pointer whose size and alignment match, and both paths compute the same layout for a byte slice, so the old free was sound. It differed only from how the response buffer is released. Release the code buffer through Box::from_raw on a slice pointer, so both buffers are freed the same way they were allocated. Ticket: 8803pull/16459/head
parent
0c534c9ccd
commit
2054e9bfcf
Loading…
Reference in New Issue