Correct pointer subtraction in KASSERT().
The assertion would never fire without truly spectacular future programming errors. Reported by: Coverity CID: 1391367, 1391368 Sponsored by: DARPA, AFRL
This commit is contained in:
parent
c0fd148b5d
commit
d8b2f0790b
@ -1145,8 +1145,7 @@ __elfN(freebsd_fixup)(register_t **stack_base, struct image_params *imgp)
|
|||||||
|
|
||||||
free(imgp->auxargs, M_TEMP);
|
free(imgp->auxargs, M_TEMP);
|
||||||
imgp->auxargs = NULL;
|
imgp->auxargs = NULL;
|
||||||
KASSERT((pos - argarray) / sizeof(*pos) <= AT_COUNT,
|
KASSERT(pos - argarray <= AT_COUNT, ("Too many auxargs"));
|
||||||
("Too many auxargs"));
|
|
||||||
|
|
||||||
error = copyout(argarray, auxbase, sizeof(*argarray) * AT_COUNT);
|
error = copyout(argarray, auxbase, sizeof(*argarray) * AT_COUNT);
|
||||||
free(argarray, M_TEMP);
|
free(argarray, M_TEMP);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user