We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In https://github.com/openxla/xla/blob/main/third_party/tsl/tsl/lib/io/zlib_outputbuffer.cc#L158 we are truncating a 64-bit size to 32-bit and comparing it to a threshold.
When the size of input data is too big it will wrap around and the check will pass: the truncated size is smaller than the available space (when it actually is not). This will then cause a crash at https://github.com/openxla/xla/blob/main/third_party/tsl/tsl/lib/io/zlib_outputbuffer.cc#L77.
data
May I suggest instead the integer cast to be:
if (bytes_to_write <= static_cast<size_t>(AvailableInputSpace())) {
i.e. you are casting to a larger, not a smaller, type.
The text was updated successfully, but these errors were encountered:
Thanks ! Could you provide a test case?
Sorry, something went wrong.
I have fixed it in the way you suggested (2abc3fd). Please let me know whether it works now as expected.
thanks for the quick fix! trying to build from source but encountering some hiccups...
No branches or pull requests
In https://github.com/openxla/xla/blob/main/third_party/tsl/tsl/lib/io/zlib_outputbuffer.cc#L158 we are truncating a 64-bit size to 32-bit and comparing it to a threshold.
When the size of input
data
is too big it will wrap around and the check will pass: the truncated size is smaller than the available space (when it actually is not). This will then cause a crash at https://github.com/openxla/xla/blob/main/third_party/tsl/tsl/lib/io/zlib_outputbuffer.cc#L77.May I suggest instead the integer cast to be:
i.e. you are casting to a larger, not a smaller, type.
The text was updated successfully, but these errors were encountered: