Fix a Coverity error in the aio_kqueue_test that could theoretically
(but probably not realistically) cause over-indexing an array.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 61512 Build 58396: arc lint + arc unit
Event Timeline
Comment Actions
I think this is OK. But it would also be fine just to put an assert(j < max_queue_per_proc before the array dereference.
Comment Actions
That was actually my first inclination, but didn't know if it was better to have the explicit message and let the test fail gracefully rather than have it abort on an assert.
Doing an assert would certainly be more straightforward and perhaps more clearly indicate that this is a scenario that should not ever happen.
I think I'll take your suggestion and revise this to use the assert method.