Author: pfg
Date: Fri May 13 02:58:11 2016
New Revision: 299586
URL: https://svnweb.freebsd.org/changeset/base/299586

Log:
  i2c(8): uninitialized variable (UNINIT).
  
  If i2c_opt.width is somehow zero, the bufsize will be left uninitialized
  and make cause trouble later on.
  
  CID:          1331549

Modified:
  head/usr.sbin/i2c/i2c.c

Modified: head/usr.sbin/i2c/i2c.c
==============================================================================
--- head/usr.sbin/i2c/i2c.c     Fri May 13 01:52:41 2016        (r299585)
+++ head/usr.sbin/i2c/i2c.c     Fri May 13 02:58:11 2016        (r299586)
@@ -294,7 +294,8 @@ i2c_write(char *dev, struct options i2c_
                        err_msg = "error: offset malloc";
                        goto err1;
                }
-       }
+       } else
+               bufsize = 0;
 
        switch(i2c_opt.mode) {
        case I2C_MODE_STOP_START:
_______________________________________________
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