Skip to content

Conversation

@Halcao
Copy link

@Halcao Halcao commented Apr 23, 2024

This pull request fixes a potential buffer overflow in the calculation of 'test_size', as described in issue #4. In the original code, 'test_size' (in KB) was compared to 'BUFFER_SIZE' (in bytes) before converting 'test_size' to bytes. This could lead to a buffer overflow.

The fix is simple: we now convert 'test_size' to bytes before comparing it to 'BUFFER_SIZE'. This ensures that 'test_size' never exceeds 'BUFFER_SIZE', preventing any potential buffer overflow.

Moved the multiplication of 'test_size' by 1024 before comparing it to 'BUFFER_SIZE'. This prevents a potential buffer overflow when 'test_size' equals 'BUFFER_SIZE'.
@Livius90
Copy link

@linnj
Can you review and merge this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants