summaryrefslogtreecommitdiff
path: root/drivers/scsi/gdth_proc.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-06-09 16:44:02 +0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-09 19:31:46 +0400
commit238ddbb98c327a7392ced5ae65216c55969749ea (patch)
treedb32edfaa5b71261c53a87bdc4d9b860e88f4091 /drivers/scsi/gdth_proc.c
parentcf4e6363859d30f24f8cd3e8930dbff399cc3550 (diff)
downloadlinux-238ddbb98c327a7392ced5ae65216c55969749ea.tar.xz
[SCSI] gdth: fix overlapping snprintf users
Closes-bug: http://bugzilla.kernel.org/show_bug.cgi?id=13438 Closes-bug: http://bugzilla.kernel.org/show_bug.cgi?id=13437 Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/gdth_proc.c')
-rw-r--r--drivers/scsi/gdth_proc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
index 59349a316e13..1258da34fbc2 100644
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -152,6 +152,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
struct Scsi_Host *host, gdth_ha_str *ha)
{
int size = 0,len = 0;
+ int hlen;
off_t begin = 0,pos = 0;
int id, i, j, k, sec, flag;
int no_mdrv = 0, drv_no, is_mirr;
@@ -192,11 +193,11 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
if (reserve_list[0] == 0xff)
strcpy(hrec, "--");
else {
- sprintf(hrec, "%d", reserve_list[0]);
+ hlen = sprintf(hrec, "%d", reserve_list[0]);
for (i = 1; i < MAX_RES_ARGS; i++) {
if (reserve_list[i] == 0xff)
break;
- sprintf(hrec,"%s,%d", hrec, reserve_list[i]);
+ hlen += snprintf(hrec + hlen , 161 - hlen, ",%d", reserve_list[i]);
}
}
size = sprintf(buffer+len,