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:
Axel Dörfler 2007-11-19 13:57:46 +00:00
parent 4020e749da
commit e551be6e70

View File

@ -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()) {