Author: asomers
Date: Tue Nov 12 23:03:52 2019
New Revision: 354664
URL: https://svnweb.freebsd.org/changeset/base/354664

Log:
  sesutil: fix an out-of-bounds array access
  
  sesutil would allow the user to toggle an LED that was one past the maximum
  element.  If he tried, ENCIOC_GETELMSTAT would return EINVAL.
  
  Reported by:  Coverity
  Coverity CID: 1398940
  MFC after:    2 weeks
  Sponsored by: Axcient

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

Modified: head/usr.sbin/sesutil/sesutil.c
==============================================================================
--- head/usr.sbin/sesutil/sesutil.c     Tue Nov 12 22:31:59 2019        
(r354663)
+++ head/usr.sbin/sesutil/sesutil.c     Tue Nov 12 23:03:52 2019        
(r354664)
@@ -247,7 +247,7 @@ sesled(int argc, char **argv, bool setfault)
                }
 
                if (isses) {
-                       if (sesid > nobj) {
+                       if (sesid >= nobj) {
                                close(fd);
                                xo_errx(EXIT_FAILURE,
                                     "Requested SES ID does not exist");
_______________________________________________
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