mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Correct pointer subtraction in KASSERT().
The assertion would never fire without truly spectacular future programming errors. Reported by: Coverity CID: 1391370 Sponsored by: DARPA, AFRL
This commit is contained in:
parent
ed50b91880
commit
cbf7e0cba7
3 changed files with 3 additions and 6 deletions
|
|
@ -283,8 +283,7 @@ linux_fixup_elf(register_t **stack_base, struct image_params *imgp)
|
|||
AUXARGS_ENTRY(pos, AT_NULL, 0);
|
||||
free(imgp->auxargs, M_TEMP);
|
||||
imgp->auxargs = NULL;
|
||||
KASSERT((pos - argarray) / sizeof(*pos) <= LINUX_AT_COUNT,
|
||||
("Too many auxargs"));
|
||||
KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs"));
|
||||
|
||||
error = copyout(argarray, auxbase, sizeof(*argarray) * LINUX_AT_COUNT);
|
||||
free(argarray, M_TEMP);
|
||||
|
|
|
|||
|
|
@ -249,8 +249,7 @@ linux_fixup_elf(register_t **stack_base, struct image_params *imgp)
|
|||
|
||||
free(imgp->auxargs, M_TEMP);
|
||||
imgp->auxargs = NULL;
|
||||
KASSERT((pos - argarray) / sizeof(*pos) <= AT_COUNT,
|
||||
("Too many auxargs"));
|
||||
KASSERT(pos - argarray <= AT_COUNT, ("Too many auxargs"));
|
||||
|
||||
error = copyout(&argarray[0], auxbase, sizeof(*argarray) * AT_COUNT);
|
||||
free(argarray, M_TEMP);
|
||||
|
|
|
|||
|
|
@ -261,8 +261,7 @@ linux_fixup_elf(register_t **stack_base, struct image_params *imgp)
|
|||
|
||||
free(imgp->auxargs, M_TEMP);
|
||||
imgp->auxargs = NULL;
|
||||
KASSERT((pos - argarray) / sizeof(*pos) <= LINUX_AT_COUNT,
|
||||
("Too many auxargs"));
|
||||
KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs"));
|
||||
|
||||
error = copyout(argarray, auxbase, sizeof(*argarray) * LINUX_AT_COUNT);
|
||||
free(argarray, M_TEMP);
|
||||
|
|
|
|||
Loading…
Reference in a new issue