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
This commit is contained in:
parent
051ed84f28
commit
691a834cb7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=354664
@ -247,7 +247,7 @@ sesled(int argc, char **argv, bool setfault)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isses) {
|
if (isses) {
|
||||||
if (sesid > nobj) {
|
if (sesid >= nobj) {
|
||||||
close(fd);
|
close(fd);
|
||||||
xo_errx(EXIT_FAILURE,
|
xo_errx(EXIT_FAILURE,
|
||||||
"Requested SES ID does not exist");
|
"Requested SES ID does not exist");
|
||||||
|
Loading…
Reference in New Issue
Block a user