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 <winnie@debian.org>
This commit is contained in:
Patrick Winnertz 2009-02-03 19:45:39 +01:00
parent 48a85a7b97
commit f148fc29d2

View File

@ -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)
{