File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
3rdParty/LightPcapNg/LightPcapNg/src Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ void light_read_record(light_file fd, light_pcapng *record)
329329 assert ((current -> block_total_length % 4 ) == 0 );
330330
331331 //Pull out the block contents from the file
332- const uint32_t bytesToRead = current -> block_total_length - 2 * sizeof (blockSize ) - sizeof (blockType );
332+ const uint32_t bytesToRead = current -> block_total_length - 2 * sizeof (blockSize ) - sizeof (blockType ) + 2 * sizeof ( uint32_t );
333333 uint32_t * local_data = calloc (bytesToRead , 1 );
334334 bytesRead = light_read (fd , local_data , bytesToRead );
335335 if (bytesRead != bytesToRead || (bytesRead == EOF && feof (fd -> file )))
@@ -355,7 +355,7 @@ void light_read_record(light_file fd, light_pcapng *record)
355355 //So we just cheat by decrementing the data pointer back 8 bytes;
356356 parse_by_block_type (current , local_data , local_data - 2 );
357357
358- free (local_data );
358+ free (local_data - 2 );
359359 * record = current ;
360360
361361 return ;
You can’t perform that action at this time.
0 commit comments