From e7c46102d665999535d4b26a9003ad6b3298662c Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Mon, 24 Feb 2025 08:31:42 +0000 Subject: [PATCH] ext2spice: mergeAttr() fix, leak removal and restore original intention --- ext2spice/ext2spice.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index 4b1e4aeb..ae3c7b0e 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -4252,11 +4252,11 @@ mergeAttr(a1, a2) *a1 = *a2; else { - char *t; - int l1 = strlen(*a1); - int l2 = strlen(*a2); - t = (char *) mallocMagic((unsigned int)((l1 + l2) + 1)); - t = (char *) strcat(*a1, *a2); + size_t l1 = strlen(*a1); + size_t l2 = strlen(*a2); + char *t = (char *) mallocMagic(l1 + l2 + 1); + strcpy(t, *a1); /* strcpy_advance() */ + strcat(t, *a2); freeMagic(*a1); *a1 = t; }