mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-08-08 03:23:39 +00:00
Fix another vulnerable spot for crashes.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
parent
17a2cdbe35
commit
f720261d46
@ -122,6 +122,8 @@ static gguf_context *load_gguf(const char *fname) {
|
|||||||
|
|
||||||
static int32_t get_arch_key_u32(std::string const &modelPath, std::string const &archKey) {
|
static int32_t get_arch_key_u32(std::string const &modelPath, std::string const &archKey) {
|
||||||
auto * ctx = load_gguf(modelPath.c_str());
|
auto * ctx = load_gguf(modelPath.c_str());
|
||||||
|
if (!ctx)
|
||||||
|
return -1;
|
||||||
auto arch = get_arch_name(ctx);
|
auto arch = get_arch_name(ctx);
|
||||||
|
|
||||||
int32_t value = -1;
|
int32_t value = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user