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

SQL: Handle null values better #12

Merged
merged 2 commits into from Jan 18, 2018
Merged

Conversation

mtijanic
Copy link
Member

mysql_stmt_bind_result() will not change the length parameter if the result is null, so we end up trying to allocate memory using an uninitialized location for size, which tends to fail with std::bad_alloc. So now we initialize it to zero beforehand.

Verified with the Arelith problematic query. Added tests to nwnx_sql_t.nss. Didn't test on PgSQL.

@Liareth Liareth merged commit b5e4b3d into nwnxee:master Jan 18, 2018
@mtijanic mtijanic deleted the mysql-bugfix branch January 18, 2018 11:20
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.

None yet

2 participants