Spaces:
Running
Running
Commit
·
deb934d
1
Parent(s):
5c36e7c
opencl : fix possible buffer overflow in dump_tensor (llama/14490)
Browse files
ggml/src/ggml-opencl/ggml-opencl.cpp
CHANGED
|
@@ -3199,7 +3199,7 @@ static void dump_tensor(ggml_backend_t backend, const struct ggml_tensor * tenso
|
|
| 3199 |
|
| 3200 |
// Open file and dump.
|
| 3201 |
char fname[512];
|
| 3202 |
-
|
| 3203 |
FILE * f = fopen(fname, "w");
|
| 3204 |
if (!f) {
|
| 3205 |
printf("Failed to open %s\n", fname);
|
|
|
|
| 3199 |
|
| 3200 |
// Open file and dump.
|
| 3201 |
char fname[512];
|
| 3202 |
+
snprintf(fname, sizeof(fname), "./tensor-dumps/%s.txt", tensor->name);
|
| 3203 |
FILE * f = fopen(fname, "w");
|
| 3204 |
if (!f) {
|
| 3205 |
printf("Failed to open %s\n", fname);
|