From: Brendan Shanks bshanks@codeweavers.com
--- tools/winebuild/import.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 1ca2048284b..bbf722633ae 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -217,7 +217,8 @@ static char *encode_dll_name( const char *name ) ret = p = xmalloc( len * 4 + 1 ); for ( ; len > 0; len--, name++) { - if (!strchr( valid_chars, *name )) p += sprintf( p, "$x%02x", *name ); + if (!strchr( valid_chars, *name )) + p += snprintf( p, (len * 4 + 1) - (p - ret), "$x%02x", *name ); else *p++ = *name; } *p = 0;