Skip to content

Commit

Permalink
ggml : fix bounds checking of zero size views (ggerganov#6347)
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren authored Mar 27, 2024
1 parent 3a03459 commit e5b89a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ static struct ggml_tensor * ggml_new_tensor_impl(
data_size *= ne[i];
}

GGML_ASSERT(view_src == NULL || data_size + view_offs <= ggml_nbytes(view_src));
GGML_ASSERT(view_src == NULL || data_size == 0 || data_size + view_offs <= ggml_nbytes(view_src));

void * data = view_src != NULL ? view_src->data : NULL;
if (data != NULL) {
Expand Down

0 comments on commit e5b89a4

Please sign in to comment.