mirror of
https://github.com/pbatard/rufus.git
synced 2025-06-08 02:14:45 -04: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:
parent
b83b087b52
commit
ced2589c4d
2 changed files with 10 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue