]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
Fix heap corruption from wmode out-of-bound writes on windows (#6272)
authorRick G <redacted>
Sun, 24 Mar 2024 21:45:56 +0000 (14:45 -0700)
committerGitHub <redacted>
Sun, 24 Mar 2024 21:45:56 +0000 (22:45 +0100)
commita32b77c4b2c1808654d0b952f26c37d73d2e746b
treef146e7bd8007a0761ca64236858d950b6c5b747b
parenta0e584defd8c16e7a51ab895f595df0448d710d0
Fix heap corruption from wmode out-of-bound writes on windows (#6272)

* would throw error on VS2022 on GGML_FREE(wmode)
* wchar_t is usually 2 bytes, but malloc wants bytes
  * therefore `*wmode_p++ = (wchar_t)*mode;` could write off the end of the allocation
* Fixes error possibly introduced by https://github.com/ggerganov/llama.cpp/pull/6248
ggml.c