Nikolay Sivov (@nsivov) commented about dlls/ntdll/unix/system.c:
debugstr_guid(vendor), buffer, retlen, attrib );
+#if defined(__linux__) || defined(__gnu_linux__)
- int fd, rc;
- size_t bytes, pos = 0;
- ssize_t ssz;
- char filename[256];
- char *cname;
- struct stat stat_info = {0};
- if(!name || !vendor || !attrib)
- {
return ERROR_INVALID_PARAMETER;
- }
- cname = (char *) malloc(name->Length);
- ntdll_wcstoumbs(name->Buffer, name->Length, cname, name->Length, FALSE);
Allocation size is a caller argument, so you'll need to check for allocation failure. Note that now you assume that multibyte size does not exceed twice the character length of a W string. For example for environment strings we use multiplier of 3. Second argument to ntdll_wcstoumbs() is incorrect.