Forgot to check for NULL data parameter in Udf::calculate_crc().

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5571 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2003-12-04 23:04:15 +00:00
parent 04d90c2afa
commit 9dccd3a042

View File

@ -162,8 +162,10 @@ uint16
Udf::calculate_crc(uint8 *data, uint16 length)
{
uint16 crc = 0;
for ( ; length > 0; length--, data++)
crc = Udf::kCrcTable[(crc >> 8 ^ *data) & 0xff] ^ (crc << 8);
if (data) {
for ( ; length > 0; length--, data++)
crc = Udf::kCrcTable[(crc >> 8 ^ *data) & 0xff] ^ (crc << 8);
}
return crc;
}