From: Georgi Gerganov Date: Sat, 20 Jul 2024 14:15:42 +0000 (+0300) Subject: gguf : handle null name during init (llama/8587) X-Git-Tag: upstream/0.0.1642~506 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=20f5a13715470ea442a0522a6735a4e25d9450df;p=pkg%2Fggml%2Fsources%2Fggml gguf : handle null name during init (llama/8587) --- diff --git a/src/ggml.c b/src/ggml.c index e89efb32..aeb6c009 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -21014,7 +21014,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p gguf_tensor_info_sanitize(info); // make sure there is no duplicated tensor names - for (uint64_t j = 0; j < i; ++j) { + for (uint64_t j = 0; j < i && ok; ++j) { if (strcmp(info->name.data, ctx->infos[j].name.data) == 0) { fprintf(stderr, "%s: duplicated tensor name %s\n", __func__, info->name.data); ok = false;