SHA256
1
0
forked from pool/ipmitool
ipmitool/increase_possible_fw_file_size.patch
Klaus Kämpf 16f3002554 - Update to 1.8.13
Changes: many, see
  http://sourceforge.net/projects/ipmitool/files/ipmitool/1.8.13/
- drop patches included upstream
  * compile-fixes.patch
  * ekanalyzer_fix_wrong_type_comparison.patch
  * increase_possible_fw_file_size.patch

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmitool?expand=0&rev=17
2013-10-04 07:00:51 +00:00

35 lines
1.0 KiB
Diff

diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-ipmitool-1.8.13/lib/ipmi_fwum.c ./lib/ipmi_fwum.c
--- ../orig-ipmitool-1.8.13/lib/ipmi_fwum.c 2013-08-23 21:02:34.000000000 +0200
+++ ./lib/ipmi_fwum.c 2013-10-04 08:43:50.435904445 +0200
@@ -142,7 +142,8 @@
extern int verbose;
static unsigned char fileName[512];
-static unsigned char firmBuf[1024*512];
+#define MAX_FW_FILE_SIZE 1024*512
+static unsigned char firmBuf[MAX_FW_FILE_SIZE];
static tKFWUM_SaveFirmwareInfo saveFirmwareInfo;
static void KfwumOutputHelp(void);
@@ -476,6 +477,12 @@
tKFWUM_Status status = KFWUM_STATUS_ERROR;
FILE * pFileHandle;
+ if(fileSize >= MAX_FW_FILE_SIZE)
+ {
+ printf("Error: Firmware file size exceeds %dK\n", MAX_FW_FILE_SIZE / 1024);
+ return KFWUM_STATUS_ERROR;
+ }
+
pFileHandle = fopen((const char *)pFileName, "rb");
if(pFileHandle)
@@ -764,6 +771,7 @@
}
}
}
+ fclose(pFileHandle);
}
return status;
}