Spaces:
Running
Running
Justin Santa Barbara
commited on
Commit
·
31cad24
1
Parent(s):
af16d74
rpc : avoid uninitialized memory in serialize_tensor (llama/13210)
Browse files
ggml/src/ggml-rpc/ggml-rpc.cpp
CHANGED
|
@@ -518,6 +518,11 @@ static rpc_tensor serialize_tensor(const ggml_tensor * tensor) {
|
|
| 518 |
result.view_src = reinterpret_cast<uint64_t>(tensor->view_src);
|
| 519 |
result.view_offs = tensor->view_offs;
|
| 520 |
result.data = reinterpret_cast<uint64_t>(tensor->data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 521 |
snprintf(result.name, GGML_MAX_NAME, "%s", tensor->name);
|
| 522 |
return result;
|
| 523 |
}
|
|
|
|
| 518 |
result.view_src = reinterpret_cast<uint64_t>(tensor->view_src);
|
| 519 |
result.view_offs = tensor->view_offs;
|
| 520 |
result.data = reinterpret_cast<uint64_t>(tensor->data);
|
| 521 |
+
|
| 522 |
+
// Avoid sending uninitialized data over the wire
|
| 523 |
+
memset(result.name, 0, sizeof(result.name));
|
| 524 |
+
memset(result.padding, 0, sizeof(result.padding));
|
| 525 |
+
|
| 526 |
snprintf(result.name, GGML_MAX_NAME, "%s", tensor->name);
|
| 527 |
return result;
|
| 528 |
}
|