From be7808dca3571d02c88dcdf30c5657fbace6c21f Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 30 Mar 2019 16:58:51 +0000 Subject: [PATCH] Fix branding after r345661. In particular, elf32 FreeBSD binaries were not executed on LP64 hosts. The interp_name_len value should account for the nul terminator. This is needed for strncmp()s in brand checking code to work. Reported by: andreast Sponsored by: The FreeBSD Foundation MFC after: 12 days (together with r345661) --- sys/kern/imgact_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index a62ee7187de6..ddf242512129 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -279,7 +279,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, boolean_t ret; int i, interp_name_len; - interp_name_len = interp != NULL ? strlen(interp) : 0; + interp_name_len = interp != NULL ? strlen(interp) + 1 : 0; /* * We support four types of branding -- (1) the ELF EI_OSABI field