-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Fix unitialized memory in H5Tconv.c #4266
Conversation
dst_aligned is unitialized and flagged in float --> long double conversions
From the dtransform test:
|
Strange. Do we know if this is from uninitialized data coming from the test? |
It's a stack-allocated variable, so no. It's also being used as a destination, not a source.
|
Uninitialized value was created by a heap allocation It's coming from a type conversion buffer that's malloced in the library: https://github.com/HDFGroup/hdf5/blob/develop/src/H5Dio.c#L1451 |
In 93754ca, I see "* Rework type conversion buffer allocation. Only one buffer is shared |
But the last line of the sanitizer output:
|
I'm guessing we get different results based on whether free lists are enabled or not. With them disabled, I can see that |
That said, it seems like the buffer was switched from calloc to malloc for a reason (probably performance). But it'd also be nice to solve the problem where it originates from rather than in the type conversion code, if possible. |
I have a feeling that it's not in the type conversion macro also (i.e. the memset is masking the root cause) |
Closing since we'll fix this closer to the root cause. See issue #4529. |
dst_aligned is unitialized and flagged in float --> long double conversions