[misc] add arbitrary buffer allocation to GetResource()

* If duplicate is TRUE and len is non-zero, then a buffer of len size,
  padded with zeroes, is allocated for the resource.
This commit is contained in:
Pete Batard 2020-02-19 12:41:13 +00:00
parent 841b79f45d
commit b8579c04da
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
6 changed files with 27 additions and 12 deletions

View file

@ -1633,6 +1633,7 @@ static void InitDialog(HWND hDlg)
uprintf(APPLICATION_NAME " " APPLICATION_ARCH " v%d.%d.%d%s%s", rufus_version[0], rufus_version[1], rufus_version[2],
IsAlphaOrBeta(), (ini_file != NULL)?"(Portable)":"");
for (i=0; i<ARRAYSIZE(resource); i++) {
len = 0;
buf = (char*)GetResource(hMainInstance, resource[i], _RT_RCDATA, "ldlinux_sys", &len, TRUE);
if (buf == NULL) {
uprintf("Warning: could not read embedded Syslinux v%d version", i+4);