15 Jun
2022
15 Jun
'22
8:36 p.m.
Alexandre Julliard (@julliard) commented about dlls/ntdll/unix/system.c:
return cmz; }
-static const char * get_sys_str(const char *path, char *s) +static const char * get_sys_str(const char *dirname, const char *basename, char *s) { - FILE *f = fopen(path, "r"); + char path[64]; + FILE *f; const char *ret = NULL;
- if (f) + if (snprintf(path, sizeof(path), "%s/%s", dirname, basename) < 0) return NULL;
snprintf doesn't return -1 on overflow (which is the only failure you care about here). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/134#note_2141