Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crc32_iscsi_01 touches memory when the buffer length is zero #43

Closed
shelepov opened this issue Aug 14, 2018 · 4 comments
Closed

crc32_iscsi_01 touches memory when the buffer length is zero #43

shelepov opened this issue Aug 14, 2018 · 4 comments

Comments

@shelepov
Copy link

crc32_iscsi_01.asm, line 408: mov rbx, qword [bufptmp]

When the buffer length is zero (and the buffer address is 64-bit aligned), the above line reads a qword at the buffer address, which is technically reading past the end of the buffer. In particular, calling the function with (NULL, 0, crc) results in a segfault.

@gbtucker
Copy link
Contributor

Thanks for reporting @shelepov. I think we can fix by moving the short len test to before the align test. I'll give it a try and let you know.

@gbtucker
Copy link
Contributor

Pushed a fix for this 105eeb9. Please give it a try @shelepov and let us know.

@shelepov
Copy link
Author

Looks good.

@gbtucker
Copy link
Contributor

Thanks for testing.

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

No branches or pull requests

2 participants