From: Harald Hoyer Date: Wed, 16 Sep 2009 15:34:47 +0000 Subject: [PATCH] scsi_id: prevent buffer overflow in check_fill_0x83_prespc3() Message-Id: <1253115287-32328-1-git-send-email-harald@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org see https://bugzilla.redhat.com/show_bug.cgi?idQ6920 --- extras/scsi_id/scsi_serial.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c index 9235912..c456507 100644 --- a/extras/scsi_id/scsi_serial.c +++ b/extras/scsi_id/scsi_serial.c @@ -582,7 +582,7 @@ static int check_fill_0x83_prespc3(struct udev *udev, serial[j++] = hex_str[(page_83[4+i] & 0xf0) >> 4]; serial[j++] = hex_str[ page_83[4+i] & 0x0f]; } - strcpy(serial_short, serial); + strncpy(serial_short, serial, max_len-1); return 0; } -- 1.6.2.5