Skip to content

Commit

Permalink
check name len
Browse files Browse the repository at this point in the history
  • Loading branch information
xjzhou committed Jul 5, 2024
1 parent 019f03a commit be0d969
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static bool searchBArray(BArray *array, const char *field_name, int32_t name_len
}
for (int i = 0; i < array->size; i++) {
Field *field = benchArrayGet(array, i);
if (strncmp(field->name, field_name, name_len) == 0) {
if (strlen(field->name) == name_len && strncmp(field->name, field_name, name_len) == 0) {
if (field->type == field_type) {
return true;
}
Expand Down

0 comments on commit be0d969

Please sign in to comment.