From f148fc29d2737eef087a6ce62d6369b1260a5327 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 3 Feb 2009 19:45:39 +0100 Subject: [PATCH] Fixing a theoretical buffer overflow which was reported by Roland Illig if the concat function was called with more than 32 parameters there will be a buffer overflow. This will add a small check to ensure that we concat only 32 parameters. Signed-off-by: Patrick Winnertz --- mhl/string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mhl/string.h b/mhl/string.h index ee74e1d48..da8658406 100644 --- a/mhl/string.h +++ b/mhl/string.h @@ -71,7 +71,7 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...) va_start(args,base); char* a; /* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */ - while ((a = va_arg(args, char*))!=(char*)1) + while ((a = va_arg(args, char*))!=(char*)1 && count <= 31 ) { if (a) {