Skip to content

Conversation

sirus20x6
Copy link
Contributor

This commit fixes an unsafe character conversion in the ggml_fopen function on Windows. The file mode string was being converted from char * to wchar_t * by simple casting, which is not safe for multi-byte character sets.

This change replaces the manual conversion with a call to the ggml_mbstowcs helper function, which properly handles UTF-8 to wide character conversion. This makes the code more robust and correct, especially for handling file paths on Windows.

This commit fixes an unsafe character conversion in the `ggml_fopen` function on Windows. The file `mode` string was being converted from `char *` to `wchar_t *` by simple casting, which is not safe for multi-byte character sets.

This change replaces the manual conversion with a call to the `ggml_mbstowcs` helper function, which properly handles UTF-8 to wide character conversion. This makes the code more robust and correct, especially for handling file paths on Windows.
@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant