If a device returns an invalid size, we shouldn't crash.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22956 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4020e749da
commit
e551be6e70
@ -491,7 +491,8 @@ DataEditor::SetTo(BEntry &entry, const char *attribute)
|
||||
|
||||
fSize = 1LL * geometry.head_count * geometry.cylinder_count
|
||||
* geometry.sectors_per_track * geometry.bytes_per_sector;
|
||||
|
||||
if (fSize < 0)
|
||||
fSize = 0;
|
||||
if (!isFileSystem)
|
||||
fBlockSize = geometry.bytes_per_sector;
|
||||
} else if (entry.IsDirectory() || entry.IsSymLink()) {
|
||||
|
Loading…
Reference in New Issue
Block a user