You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1467
-- Commit Summary --
* sqlops: sqlops_do_query - Make result parameter optional in C API
-- File Changes --
M src/modules/sqlops/sql_api.c (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1467.patch https://github.com/kamailio/kamailio/pull/1467.diff
Hello Hugh, thank you for the pull request. Wouldn't make sense to move the null check to the beginning of the function? Otherwise sql_get_result would call with a null before your check.
Forget my previous comment - I think we should add a null check to sql_do_query as well.
sql_get_result does not currently check the 'name' parameter and will crash in core_case_hash if this is NULL. This is also true for sql_get_connection and sql_init_con. However, these three functions are only called from within the sqlops module. I will add a check to the C-API/KEMI wrapper functions that call them (sqlops_do_query, sqlops_get_value, sqlops_is_null, etc.)? Is it needed inside sql_get_result as well?
@que273 pushed 1 commit.
53e1326 sqlops: Add NULL parameter check to C/KEMI API functions
henningw approved this pull request.
Thank you for the additional checks!
Closed #1467.
Merged and closed.
Reopened #1467.
Merged #1467.