public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: linux-scsi@vger.kernel.org
Cc: patmans@us.ibm.com
Subject: [PATCH] sg snprintf()s in 2.5.59
Date: Thu, 30 Jan 2003 16:45:49 +1100	[thread overview]
Message-ID: <3E38BC0D.9040608@torque.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

Patrick Mansfield reminded me that the attached patch
hasn't made it into the 2.5 series yet. It's absence
causes some corruption for long sg_driverfs_dev.name
strings.

Doug Gilbert

[-- Attachment #2: sg_2559_snpr.diff --]
[-- Type: text/plain, Size: 991 bytes --]

--- linux/drivers/scsi/sg.c	2003-01-14 10:46:58.000000000 +1100
+++ linux/drivers/scsi/sg.c2559snpr	2003-01-30 16:38:47.000000000 +1100
@@ -19,7 +19,7 @@
  */
 #include <linux/config.h>
 #ifdef CONFIG_PROC_FS
-static char *sg_version_str = "Version: 3.5.27 (20020812)";
+static char *sg_version_str = "Version: 3.5.27 (20030130)";
 #endif
 static int sg_version_num = 30527;	/* 2 digits for each component */
 /*
@@ -1455,9 +1455,9 @@
 	sdp->sg_tablesize = scsidp->host ? scsidp->host->sg_tablesize : 0;
 
 	memset(&sdp->sg_driverfs_dev, 0, sizeof (struct device));
-	sprintf(sdp->sg_driverfs_dev.bus_id, "%s:gen",
+	snprintf(sdp->sg_driverfs_dev.bus_id, BUS_ID_SIZE, "%s:gen",
 		scsidp->sdev_driverfs_dev.bus_id);
-	sprintf(sdp->sg_driverfs_dev.name, "%sgeneric",
+	snprintf(sdp->sg_driverfs_dev.name, DEVICE_NAME_SIZE, "%sgeneric",
 		scsidp->sdev_driverfs_dev.name);
 	sdp->sg_driverfs_dev.parent = &scsidp->sdev_driverfs_dev;
 	sdp->sg_driverfs_dev.bus = scsidp->sdev_driverfs_dev.bus;

                 reply	other threads:[~2003-01-30  5:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E38BC0D.9040608@torque.net \
    --to=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=patmans@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox