From: Martin Matuška Date: Thu, 25 Dec 2025 09:14:23 +0000 (+0100) Subject: Merge pull request #2816 from AZero13/strdup X-Git-Tag: v3.8.5~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bec0337316faac341df6f7953d2032cd730c4399;p=thirdparty%2Flibarchive.git Merge pull request #2816 from AZero13/strdup Error check strdup for path name (cherry picked from commit 095609e89bbea9a59e4c1405fb3f360db316c52e) --- diff --git a/libarchive_fe/line_reader.c b/libarchive_fe/line_reader.c index 0af9db53c..a4bc84b7f 100644 --- a/libarchive_fe/line_reader.c +++ b/libarchive_fe/line_reader.c @@ -64,6 +64,8 @@ lafe_line_reader(const char *pathname, int nullSeparator) lr->nullSeparator = nullSeparator; lr->pathname = strdup(pathname); + if (lr->pathname == NULL) + lafe_errc(1, ENOMEM, "Can't open %s", pathname); if (strcmp(pathname, "-") == 0) lr->f = stdin;