From a0d8f55f8affc898209329a355aa2974beae86d2 Mon Sep 17 00:00:00 2001 From: bz Date: Sat, 3 Oct 2009 10:50:00 +0000 Subject: [PATCH] Print a warning in case we cannot add more brandinfo because we would overflow the MAX_BRANDS sized array. Reviewed by: kib MFC After: 1 month --- sys/kern/imgact_elf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index ba5833a5bd60..4ed7382a6f68 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -180,8 +180,11 @@ __elfN(insert_brand_entry)(Elf_Brandinfo *entry) break; } } - if (i == MAX_BRANDS) + if (i == MAX_BRANDS) { + printf("WARNING: %s: could not insert brandinfo entry: %p\n", + __func__, entry); return (-1); + } return (0); }