]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't crash if /var/tmp doesn't exist
authorShu-Chun Weng <scw@google.com>
Mon, 3 May 2021 23:47:10 +0000 (16:47 -0700)
committerFangrui Song <i@maskray.me>
Sat, 28 Aug 2021 00:26:06 +0000 (17:26 -0700)
`xstat` is checked `stat64` crashing the program if the latter returns
failure. In this loop, we are trying to find one folder that satisfies
the condition, no reason to crash the program if one folder doesn't.

io/tst-copy_file_range.c

index 3d531a19370911e52803a5b5fffe83b0713df294..38763328d380b5dbd9bab3625673178472b41237 100644 (file)
@@ -759,8 +759,7 @@ do_test (void)
           }
 
         struct stat64 cstat;
-        xstat (path, &cstat);
-        if (cstat.st_dev == instat.st_dev)
+        if (stat (path, &cstat) != 0 || cstat.st_dev == instat.st_dev)
           {
             free (to_free);
             continue;