WillAyd commented on code in PR #777:
URL: https://github.com/apache/arrow-adbc/pull/777#discussion_r1228718834
##########
c/driver/common/utils.c:
##########
@@ -884,7 +884,7 @@ struct AdbcGetObjectsConstraint*
AdbcGetObjectsDataGetConstraintByName(
for (int64_t i = 0; i < table->n_table_constraints; i++) {
struct AdbcGetObjectsConstraint* constraint =
table->table_constraints[i];
struct ArrowStringView name = constraint->constraint_name;
- if (!strncmp(name.data, constraint_name, name.size_bytes)) {
+ if (!constraint_name || !strncmp(name.data, constraint_name,
name.size_bytes)) {
Review Comment:
Current implementation does allow for UB if `constraint_name` is NULL so
makes sense to return early if that happens, though I think that should be on
function entry and also just return NULL there instead of grabbing the first
constraint?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]