Unverified Commit 6d861432 authored by Shawn Webb's avatar Shawn Webb
Browse files

Ensure the sanitized path is at least two characters long

With /bin/sh, if you give it "./" as a command, it will try to execute
that. This use case was not tested and could cause a kernel panic.
Signed-off-by: Shawn Webb's avatarShawn Webb <shawn.webb@hardenedbsd.org>
Sponsored-by:	SoldierX
parent 57d21cab
......@@ -94,6 +94,10 @@ tpe_check(struct image_params *imgp, secadm_prison_entry_t *entry)
return (0);
if (strlen(p1) < 2) {
return (EINVAL);
newpath = malloc((p1 - path) + 1, M_SECADM, M_WAITOK | M_ZERO);
strncpy(newpath, path, p1 - path);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment