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

More UBSAN fixes #1178

Merged
merged 3 commits into from
Nov 10, 2024
Merged

More UBSAN fixes #1178

merged 3 commits into from
Nov 10, 2024

Conversation

vadz
Copy link
Member

@vadz vadz commented Nov 9, 2024

Fix a couple of other problems and make the other ones don't go unnoticed any more.

vadz added 3 commits November 9, 2024 23:33
oracle_standard_into_type_backend::type_ may not be initialized when
clean_up() is called, and comparing its value with x_xmltype and other
constants was triggering undefined behaviour in this case, so avoid
doing it by checking if ociData_ is non-null before doing it.

Also modify oracle_standard_use_type_backend in a similar way, even if
it doesn't suffer from this problem, for symmetry.
This is similar to 96668e9 (Don't pass null pointers to memcpy() in
trivial_blob_backend code, 2024-10-16) and done for the same reason:
when there is no data to read/write, the buffer pointer may be null and
passing it to memcpy() triggers UBSAN error, so avoid doing it.
Otherwise the errors reported by it could remain unnoticed, as happened
with the UB detected in Oracle backend.
@vadz vadz merged commit ee5ce98 into SOCI:master Nov 10, 2024
15 checks passed
@vadz vadz deleted the more-ubsan-fixes branch November 10, 2024 15:14
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.

1 participant