-/* $OpenBSD: exec_elf.c,v 1.115 2015/04/30 03:11:21 guenther Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.116 2015/04/30 11:15:28 jsg Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
for (i = 0, pp = ph; i < eh->e_phnum; i++, pp++) {
if (pp->p_type == PT_INTERP && !interp) {
- if (pp->p_filesz >= MAXPATHLEN)
+ if (pp->p_filesz < 2 || pp->p_filesz > MAXPATHLEN)
goto bad;
interp = pool_get(&namei_pool, PR_WAITOK);
if ((error = ELFNAME(read_from)(p, epp->ep_vp,