From ee6ea51c0202704b6bcfa9d231c99118bdfd3ec8 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 6 Jun 2001 21:03:40 +0000 Subject: [PATCH] Check for enough buffer space in PROFILE_GetSection(). --- files/profile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/profile.c b/files/profile.c index 5ae6f65b639..116060d6501 100644 --- a/files/profile.c +++ b/files/profile.c @@ -722,6 +722,8 @@ static INT PROFILE_GetSection( PROFILESECTION *section, LPCSTR section_name, PROFILE_CopyEntry( buffer, key->name, len - 1, handle_env ); len -= strlen(buffer) + 1; buffer += strlen(buffer) + 1; + if (len < 2) + break; if (return_values && key->value) { buffer[-1] = '='; PROFILE_CopyEntry ( buffer,