From: Eli Zaretskii Date: Sat, 3 May 2008 10:11:22 +0000 (+0000) Subject: (Ffile_attributes): Don't allow the device number become negative. X-Git-Tag: emacs-pretest-22.2.90~148 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=064032d03080c9f64ce5196a6f2664acdbeb95e4;p=emacs.git (Ffile_attributes): Don't allow the device number become negative. --- diff --git a/src/ChangeLog b/src/ChangeLog index 0849e9ee4b7..8efef814555 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-05-03 Eli Zaretskii + + * dired.c (Ffile_attributes): Don't allow the device number become + negative. + 2008-05-02 YAMAMOTO Mitsuharu * config.in: Regenerate. diff --git a/src/dired.c b/src/dired.c index 31b7e19ddae..7936e04a54e 100644 --- a/src/dired.c +++ b/src/dired.c @@ -1048,8 +1048,11 @@ Elements of the attribute list are: /* But keep the most common cases as integers. */ values[10] = make_number (ino); - /* Likewise for device. */ - if (FIXNUM_OVERFLOW_P (s.st_dev)) + /* Likewise for device, but don't let it become negative. We used + to use FIXNUM_OVERFLOW_P here, but that won't catch large + positive numbers such as 0xFFEEDDCC. */ + if ((EMACS_INT)s.st_dev < 0 + || (EMACS_INT)s.st_dev > MOST_POSITIVE_FIXNUM) values[11] = Fcons (make_number (s.st_dev >> 16), make_number (s.st_dev & 0xffff)); else