Commit 2bcdddd
authored
fix(rpc): prevent division by zero in deserialize_tensor (ggml-org#20712)
rpc : prevent division by zero in deserialize_tensor
When receiving an RPC message with a deprecated tensor type (e.g., type 4 or 5 where `blck_size == 0`), `ggml_row_size()` will trigger a division by zero (SIGFPE) and crash the rpc-server.
This patch adds a simple validation check in `deserialize_tensor` to return `nullptr` if the requested tensor type has a block size of 0.
(Note: This was originally reported via Security Advisory and maintainer suggested dropping a patch here).
* style: remove trailing whitespace1 parent eac9c6e commit 2bcdddd
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
1165 | 1171 | | |
1166 | 1172 | | |
1167 | 1173 | | |
1168 | 1174 | | |
1169 | 1175 | | |
1170 | | - | |
| 1176 | + | |
1171 | 1177 | | |
1172 | 1178 | | |
1173 | 1179 | | |
| |||
0 commit comments