]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
Fix heap corruption from wmode out-of-bound writes on windows (llama/6272)
authorRick G <redacted>
Sun, 24 Mar 2024 21:45:56 +0000 (14:45 -0700)
committerGeorgi Gerganov <redacted>
Wed, 27 Mar 2024 11:20:00 +0000 (13:20 +0200)
commitfc815abac49a8d23d14eeb1060c5c87f1a0b0255
tree6871c2688f883d7eff3e74569e6134e3024368ca
parenta615e8d819ca08925052b561549c1b75b4b1da81
Fix heap corruption from wmode out-of-bound writes on windows (llama/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
src/ggml.c