Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC and tinydir_file_open #52

Closed
jernejsk opened this issue Jul 18, 2017 · 1 comment
Closed

MSVC and tinydir_file_open #52

jernejsk opened this issue Jul 18, 2017 · 1 comment

Comments

@jernejsk
Copy link

There is an issue in tinydir_file_open when compiled with MSVC.

At the beginning of the function, there is following declaration:

_tinydir_char_t drive_buf[_TINYDIR_DRIVE_MAX];

_TINYDIR_DRIVE_MAX is defined as 3

Later on, there is following line:

_tinydir_strcat(drive_buf, dir_name_buf);

which always overflows the buffer.

Quick solution is to define drive_buf as

_tinydir_char_t drive_buf[_TINYDIR_PATH_MAX];
@cxong cxong closed this as completed in 47d5a79 Jul 19, 2017
@cxong
Copy link
Owner

cxong commented Jul 19, 2017

good catch!

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

No branches or pull requests

2 participants