Skip to content

Conversation

@TheFlipbook
Copy link
Contributor

  • 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 use _wfopen instead of fopen on Windows #6248

* 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 ggml-org#6248
@ggerganov ggerganov requested a review from cebtenzzre March 24, 2024 08:58
@dranger003
Copy link
Contributor

dranger003 commented Mar 24, 2024

I also get this issue running on Windows, and confirm this fix resolves the issue.

@slaren slaren merged commit a32b77c into ggml-org:master Mar 24, 2024
cebtenzzre pushed a commit to nomic-ai/llama.cpp that referenced this pull request Mar 25, 2024
…rg#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 ggml-org#6248

(cherry picked from commit a32b77c)
Signed-off-by: Jared Van Bortel <[email protected]>
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 3, 2024
…rg#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 ggml-org#6248
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants