summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/arrayprobe/files/2.0-malloc-strlen.patch')
-rw-r--r--sys-apps/arrayprobe/files/2.0-malloc-strlen.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys-apps/arrayprobe/files/2.0-malloc-strlen.patch b/sys-apps/arrayprobe/files/2.0-malloc-strlen.patch
new file mode 100644
index 00000000000..8d955a8f933
--- /dev/null
+++ b/sys-apps/arrayprobe/files/2.0-malloc-strlen.patch
@@ -0,0 +1,20 @@
+--- probe.c.old 2010-01-13 12:15:32.000000000 +0100
++++ probe.c 2010-01-13 12:16:44.000000000 +0100
+@@ -354,7 +354,7 @@
+ int drivenum = event.detail.logstatchange.logicaldrivenumber;
+ logdrvs[drivenum].state.state = event.detail.logstatchange.newlogicaldrivestate;
+ logdrvs[drivenum].state.severity = logicaldrivestatusseverity[event.detail.logstatchange.newlogicaldrivestate];
+- logdrvs[drivenum].state.message = (char *)malloc(strlen(logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate] + 1));
++ logdrvs[drivenum].state.message = (char *)malloc(strlen(logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate]) + 1);
+ strcpy (logdrvs[drivenum].state.message, logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate]);
+ }
+ if (verbose) {
+@@ -479,7 +479,7 @@
+ int ida_device = 0; /* only for use with -f , used to determine protocol to use */
+ int max_logical = 64; /* hardcoded */
+ int cur_logical = 0; /* number of drives detected */
+- logdrv *logdrvs = (logdrv *)malloc(sizeof(logdrv)*max_logical);
++ logdrv *logdrvs;
+ int worst_disk;
+ int worst_sev = SEV_NORMAL;
+ int cntr;