Huw Davies (@huw) commented about dlls/localspl/provider.c:
- HKEY hkey;
- size = sizeof(fmt_printprocessorsW) +
(wcslen(env_arch.envname) + wcslen(name)) * sizeof(WCHAR);
- reg_path = malloc(size);
- if (!reg_path)
return NULL;
- swprintf(reg_path, size / sizeof(WCHAR), fmt_printprocessorsW, env_arch.envname);
- wcscat(reg_path, name);
- status = RegOpenKeyW(HKEY_LOCAL_MACHINE, reg_path, &hkey);
- free(reg_path);
- if (status != ERROR_SUCCESS)
return NULL;
- if (!fpGetPrintProcessorDirectory(NULL, NULL, 1, (BYTE *)path, sizeof(path) - 1, &size))
Not that it really matters, but the `-1` looks a bit odd here, I'd suggest just passing `sizeof(path)`.