diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-12-11 07:11:42 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-12-11 07:11:42 +0000 |
commit | 62306f4ea9432ff9d92b5b0b6813a842242edb7a (patch) | |
tree | 1919ea49336e95d1ae4d2c9addbd5ef9be5c05dc /lib | |
parent | 1cd76b6473fff556d555981c6c723b165b0ae4c0 (diff) | |
download | FreeBSD-src-62306f4ea9432ff9d92b5b0b6813a842242edb7a.zip FreeBSD-src-62306f4ea9432ff9d92b5b0b6813a842242edb7a.tar.gz |
Be more careful about assembling/disassembling
device numbers. In particular, this should fix
a bug where archiving a device node with a very
large minor number would sometimes overflow and
corrupt the major number.
Thanks to: Ben Mesander
MFC after: 7 days
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libarchive/archive_entry.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index db92789..8c52aa5 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -609,7 +609,7 @@ archive_entry_set_rdevmajor(struct archive_entry *entry, dev_t m) dev_t d; d = entry->ae_stat.st_rdev; - entry->ae_stat.st_rdev = makedev(m, minor(d)); + entry->ae_stat.st_rdev = makedev(major(m), minor(d)); } void @@ -618,7 +618,7 @@ archive_entry_set_rdevminor(struct archive_entry *entry, dev_t m) dev_t d; d = entry->ae_stat.st_rdev; - entry->ae_stat.st_rdev = makedev( major(d), m); + entry->ae_stat.st_rdev = makedev(major(d), minor(m)); } void |