SHA256
1
0
forked from pool/ipmitool

osc rm increase_possible_fw_file_size.patch

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmitool?expand=0&rev=19
This commit is contained in:
Klaus Kämpf 2013-10-04 11:53:51 +00:00 committed by Git OBS Bridge
parent f5606de245
commit 3de31f40da

View File

@ -1,34 +0,0 @@
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;
}