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);
                        /*
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to