diff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c index 0dc9299f5434..d9884f5d1cdf 100644 --- a/sys/kern/imgact_shell.c +++ b/sys/kern/imgact_shell.c @@ -195,7 +195,7 @@ exec_shell_imgact(imgp) length = (imgp->args->argc == 0) ? 0 : strlen(imgp->args->begin_argv) + 1; /* bytes to delete */ - if (offset - length > imgp->args->stringspace) { + if (offset > imgp->args->stringspace + length) { if (sname != NULL) sbuf_delete(sname); return (E2BIG);