diff options
author | Shu-Chun Weng <scw@google.com> | 2021-05-03 16:47:10 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-08-27 17:26:06 -0700 |
commit | 8238afcd89abe20989becb1a3836291a0f8b67dd (patch) | |
tree | e3b97f9d562107970ef8cbb01876fd0aa1d0f016 | |
parent | df64d523104d05a17c9ef66345077154588a5424 (diff) | |
download | glibc-8238afcd89abe20989becb1a3836291a0f8b67dd.zip glibc-8238afcd89abe20989becb1a3836291a0f8b67dd.tar.gz glibc-8238afcd89abe20989becb1a3836291a0f8b67dd.tar.bz2 |
Don't crash if /var/tmp doesn't exist
`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.
-rw-r--r-- | io/tst-copy_file_range.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/io/tst-copy_file_range.c b/io/tst-copy_file_range.c index 3d531a1..3876332 100644 --- a/io/tst-copy_file_range.c +++ b/io/tst-copy_file_range.c @@ -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; |