public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Shu-Chun Weng <scw@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/google/grte/v5-2.27/master] Don't crash if /var/tmp doesn't exist
Date: Thu, 15 Jul 2021 19:42:52 +0000 (GMT)	[thread overview]
Message-ID: <20210715194252.9DED93AAB026@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=658b6ff7f04a0eae832c0b35adba889307ad924a

commit 658b6ff7f04a0eae832c0b35adba889307ad924a
Author: Shu-Chun Weng <scw@google.com>
Date:   Mon May 3 16:47:10 2021 -0700

    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.

Diff:
---
 io/tst-copy_file_range.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/io/tst-copy_file_range.c b/io/tst-copy_file_range.c
index 3d531a1937..38763328d3 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;


             reply	other threads:[~2021-07-15 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 19:42 Shu-Chun Weng [this message]
2021-08-28  0:38 Fangrui Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210715194252.9DED93AAB026@sourceware.org \
    --to=scw@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).