]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge pull request #2825 from AZero13/patch-2
authorTim Kientzle <kientzle@acm.org>
Sat, 27 Dec 2025 18:52:17 +0000 (10:52 -0800)
committerMartin Matuska <martin@matuska.de>
Sun, 28 Dec 2025 12:13:33 +0000 (13:13 +0100)
Error check ret before calling copy_seek_stat

(cherry picked from commit e91171c9a03077c5a1ff5f1c181fe0da4121261a)

libarchive/archive_windows.c

index 769b95928912970b3d0823eef514a117bc597b1d..3fbea6c5b6dd4b7490ae1852fed58f446999beb8 100644 (file)
@@ -747,7 +747,8 @@ __la_seek_fstat(int fd, la_seek_stat_t *st)
        int ret;
 
        ret = __hstat((HANDLE)_get_osfhandle(fd), &u);
-       copy_seek_stat(st, &u);
+       if (ret >= 0)
+               copy_seek_stat(st, &u);
        return (ret);
 }