mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[misc] add more check for malloc() errors
* Closes #772 * With thanks to @elfring
This commit is contained in:
parent
f1f620411c
commit
a10ea1498b
2 changed files with 11 additions and 5 deletions
|
@ -136,6 +136,10 @@ static loc_cmd* get_loc_cmd(char c, char* line) {
|
||||||
lcmd->unum_size++;
|
lcmd->unum_size++;
|
||||||
}
|
}
|
||||||
lcmd->unum = (uint32_t*)malloc(lcmd->unum_size * sizeof(uint32_t));
|
lcmd->unum = (uint32_t*)malloc(lcmd->unum_size * sizeof(uint32_t));
|
||||||
|
if (lcmd->unum == NULL) {
|
||||||
|
luprint("could not allocate memory");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
token = strtok(&line[i], ".,");
|
token = strtok(&line[i], ".,");
|
||||||
for (l=0; (l<lcmd->unum_size) && (token != NULL); l++) {
|
for (l=0; (l<lcmd->unum_size) && (token != NULL); l++) {
|
||||||
lcmd->unum[l] = (int32_t)strtol(token, &endptr, 0);
|
lcmd->unum[l] = (int32_t)strtol(token, &endptr, 0);
|
||||||
|
@ -1238,6 +1242,8 @@ char* replace_char(const char* src, const char c, const char* rep)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
res = (char*)malloc(str_len + count*rep_len + 1);
|
res = (char*)malloc(str_len + count*rep_len + 1);
|
||||||
|
if (res == NULL)
|
||||||
|
return NULL;
|
||||||
for (i=0,j=0; i<str_len; i++) {
|
for (i=0,j=0; i<str_len; i++) {
|
||||||
if (src[i] == c) {
|
if (src[i] == c) {
|
||||||
for(k=0; k<rep_len; k++)
|
for(k=0; k<rep_len; k++)
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 242, 376
|
IDD_DIALOG DIALOGEX 12, 12, 242, 376
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 2.10.954"
|
CAPTION "Rufus 2.10.955"
|
||||||
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
|
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
|
||||||
|
@ -320,8 +320,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,10,954,0
|
FILEVERSION 2,10,955,0
|
||||||
PRODUCTVERSION 2,10,954,0
|
PRODUCTVERSION 2,10,955,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -338,13 +338,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "2.10.954"
|
VALUE "FileVersion", "2.10.955"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "2.10.954"
|
VALUE "ProductVersion", "2.10.955"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in a new issue