mirror of
https://github.com/zlib-ng/minizip-ng
synced 2026-08-25 14:26:08 -04:00
Check for zero length path in mz_path_has_slash
Fix for https://github.com/zlib-ng/minizip-ng/issues/739
This commit is contained in:
parent
42b6b8997c
commit
3417608874
1 changed files with 1 additions and 1 deletions
2
mz_os.c
2
mz_os.c
|
|
@ -68,7 +68,7 @@ int32_t mz_path_remove_slash(char *path) {
|
|||
|
||||
int32_t mz_path_has_slash(const char *path) {
|
||||
int32_t path_len = (int32_t)strlen(path);
|
||||
if (path[path_len - 1] != '\\' && path[path_len - 1] != '/')
|
||||
if (path_len > 0 && path[path_len - 1] != '\\' && path[path_len - 1] != '/')
|
||||
return MZ_EXIST_ERROR;
|
||||
return MZ_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue