Hi,

The patch below is for sbase tar:


>From 2eec3e07a5bd1ed1fa41ca02865297ab7d8b5fa8 Mon Sep 17 00:00:00 2001
From: Hiltjo Posthuma <hil...@codemadness.org>
Date: Sat, 17 Jul 2021 21:03:27 +0200
Subject: [PATCH] tar: check if reallocarray failed

---
 tar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tar.c b/tar.c
index b74c134..122f30a 100644
--- a/tar.c
+++ b/tar.c
@@ -78,7 +78,7 @@ static const char *filtertools[] = {
 static void
 pushdirtime(char *name, time_t mtime)
 {
-       dirtimes = reallocarray(dirtimes, dirtimeslen + 1, sizeof(*dirtimes));
+       dirtimes = ereallocarray(dirtimes, dirtimeslen + 1, sizeof(*dirtimes));
        dirtimes[dirtimeslen].name = strdup(name);
        dirtimes[dirtimeslen].mtime = mtime;
        dirtimeslen++;
-- 
2.32.0

-- 
Kind regards,
Hiltjo

Reply via email to