Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Apr 2016 16:38:16 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r297527 - head/sys/cam/scsi
Message-ID:  <201604031638.u33GcGsa092204@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Apr  3 16:38:15 2016
New Revision: 297527
URL: https://svnweb.freebsd.org/changeset/base/297527

Log:
  chdone(): Prevent returning uninitialized scalar value.
  
  If there is an error different from ERESTART, there is some
  chance that we may end up accessing an uninitialized value. This
  doesn't seem likely/possible but initialize announce_buf[0],
  just in case.
  
  CID:	1006486

Modified:
  head/sys/cam/scsi/scsi_ch.c

Modified: head/sys/cam/scsi/scsi_ch.c
==============================================================================
--- head/sys/cam/scsi/scsi_ch.c	Sun Apr  3 16:25:51 2016	(r297526)
+++ head/sys/cam/scsi/scsi_ch.c	Sun Apr  3 16:38:15 2016	(r297527)
@@ -651,6 +651,7 @@ chdone(struct cam_periph *periph, union 
 		} else {
 			int error;
 
+			announce_buf[0] = '\0';
 			error = cherror(done_ccb, CAM_RETRY_SELTO,
 					SF_RETRY_UA | SF_NO_PRINT);
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604031638.u33GcGsa092204>