Skip to content

Distribute and run LLMs with a single file.

Fix irrelevant bounds check in cuda.c (#95)

Jōshin99f1e92a3225
diff --git a/llamafile/cuda.c b/llamafile/cuda.c
index ab4b2757..cb3ab75c 100644
--- a/llamafile/cuda.c
+++ b/llamafile/cuda.c
@@ -394,8 +394,8 @@ static bool ExtractCudaDso(char dso[static PATH_MAX]) {
// see if prebuilt dso is bundled in zip assets
char zip[80];
- strlcpy(zip, "/zip/ggml-cuda.", PATH_MAX);
- strlcat(zip, GetDsoExtension(), PATH_MAX);
+ strlcpy(zip, "/zip/ggml-cuda.", sizeof(zip));
+ strlcat(zip, GetDsoExtension(), sizeof(zip));
if (!FileExists(zip)) {
tinyprint(2, "prebuilt binary ", zip, " not found\n", NULL);
return false;