f7ebc0
From 78055800dd8fd2563e9248fcafda81a211fcc4d2 Mon Sep 17 00:00:00 2001
f7ebc0
From: Miroslav Lichvar <mlichvar@redhat.com>
f7ebc0
Date: Mon, 3 Jun 2013 12:54:59 +0200
f7ebc0
Subject: [PATCH 1/2] metaflac : Fix local_strcat() to terminate string
f7ebc0
 correctly.
f7ebc0
f7ebc0
The NUL char is written at incorrect place when the destination string
f7ebc0
is longer than 0, which causes memory corruption. It was broken by
f7ebc0
commit 2d6354ff2a618a79d40edbd4f208b4b07c5422f1.
f7ebc0
---
f7ebc0
 src/metaflac/utils.c | 2 +-
f7ebc0
 1 file changed, 1 insertion(+), 1 deletion(-)
f7ebc0
f7ebc0
diff --git a/src/metaflac/utils.c b/src/metaflac/utils.c
f7ebc0
index 097537b..8a31daa 100644
f7ebc0
--- a/src/metaflac/utils.c
f7ebc0
+++ b/src/metaflac/utils.c
f7ebc0
@@ -75,7 +75,7 @@ void local_strcat(char **dest, const char *source)
f7ebc0
 	*dest = safe_realloc_add_3op_(*dest, ndest, /*+*/nsource, /*+*/1);
f7ebc0
 	if(0 == *dest)
f7ebc0
 		die("out of memory growing string");
f7ebc0
-	safe_strncpy((*dest)+ndest, source, ndest + nsource + 1);
f7ebc0
+	safe_strncpy((*dest)+ndest, source, nsource + 1);
f7ebc0
 }
f7ebc0
 
f7ebc0
 static inline int local_isprint(int c)
f7ebc0
-- 
f7ebc0
1.8.1.4
f7ebc0