1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[iso] libcdio is temperamental when it comes to NULL pointers

* Fixes a crash when opening the latest gparted and probably other ISOs
This commit is contained in:
Pete Batard 2014-02-18 00:05:00 +00:00
parent b83b087b52
commit ced2589c4d
2 changed files with 10 additions and 9 deletions

View file

@ -289,18 +289,19 @@ unicode16_decode(const uint8_t *data, int i_len)
switch (data[0])
{
case 8:
r = (char*)malloc(i_len);
r = (char*)calloc(i_len, 1);
if (r == NULL)
return r;
for (i=0; i<i_len-1; i++)
r[i] = data[i+1];
r[i] = 0;
return r;
case 16:
cdio_charset_to_utf8((char*)&data[1], i_len-1, &r, "UCS-2BE");
return r;
default:
return NULL;
/* Empty string, for calls that can't take a NULL pointer */
r = (char*)calloc(1, 1);
return r;
}
}

View file

@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 1.4.4.415"
CAPTION "Rufus 1.4.4.416"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -165,7 +165,7 @@ END
RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 1.4.4.415"
CAPTION "Rufus 1.4.4.416"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -427,8 +427,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,4,415
PRODUCTVERSION 1,4,4,415
FILEVERSION 1,4,4,416
PRODUCTVERSION 1,4,4,416
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -445,13 +445,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.4.4.415"
VALUE "FileVersion", "1.4.4.416"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.4.4.415"
VALUE "ProductVersion", "1.4.4.416"
END
END
BLOCK "VarFileInfo"