aio_kqueue_test: Fix CID 1558429
Fix a Coverity error in the aio_kqueue_test that could theoretically (but probably not realistically) cause overindexing an array. Differential Revision: https://reviews.freebsd.org/D48328 Reviewed by: asomers, vangyzen Sponsored by: Dell Technologies
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/event.h>
|
||||
#include <sys/time.h>
|
||||
#include <assert.h>
|
||||
#include <aio.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
@@ -192,6 +193,7 @@ main (int argc, char *argv[])
|
||||
|
||||
for (j = 0; j < max_queue_per_proc && iocb[j] != kq_iocb;
|
||||
j++) ;
|
||||
assert(j < max_queue_per_proc);
|
||||
#ifdef DEBUG
|
||||
printf("kq_iocb %p\n", kq_iocb);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user