# HG changeset patch # User Eli Zaretskii # Date 1209809795 0 # Node ID 511a75ebd7df91398e4b71bcf52da390d6036285 # Parent 7de38dedf0a6e3ed1ad51ea39c933ca652e38a6b (Ffile_attributes): Don't allow the device number become negative. diff -r 7de38dedf0a6 -r 511a75ebd7df src/dired.c --- a/src/dired.c Sat May 03 09:45:20 2008 +0000 +++ b/src/dired.c Sat May 03 10:16:35 2008 +0000 @@ -1048,8 +1048,11 @@ make_number (low_ino & 0xffff))); } - /* 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