Module Name: src
Committed By: reinoud
Date: Fri Aug 9 20:13:18 UTC 2013
Modified Files:
src/sys/fs/udf: udf_allocation.c
Log Message:
Fix 32 bit issue in main file read-in function. On both 32 bit and 64 bit
hosts a missing cast would result in `garbage' after the 4Gbyte limit.
To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/fs/udf/udf_allocation.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/fs/udf/udf_allocation.c
diff -u src/sys/fs/udf/udf_allocation.c:1.33 src/sys/fs/udf/udf_allocation.c:1.34
--- src/sys/fs/udf/udf_allocation.c:1.33 Wed Jul 3 11:50:59 2013
+++ src/sys/fs/udf/udf_allocation.c Fri Aug 9 20:13:18 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_allocation.c,v 1.33 2013/07/03 11:50:59 reinoud Exp $ */
+/* $NetBSD: udf_allocation.c,v 1.34 2013/08/09 20:13:18 reinoud Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_allocation.c,v 1.33 2013/07/03 11:50:59 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_allocation.c,v 1.34 2013/08/09 20:13:18 reinoud Exp $");
#endif /* not lint */
@@ -586,7 +586,7 @@ translate_again:
end_foffset = foffset + len;
- if (end_foffset > lb_num * lb_size)
+ if (end_foffset > (uint64_t) lb_num * lb_size)
break; /* found */
foffset = end_foffset;
slot++;
@@ -724,13 +724,13 @@ udf_translate_file_extent(struct udf_nod
end_foffset = foffset + len;
- if (end_foffset > from * lb_size)
+ if (end_foffset > (uint64_t) from * lb_size)
break; /* found */
foffset = end_foffset;
slot++;
}
/* found overlapping slot */
- ext_offset = from * lb_size - foffset;
+ ext_offset = (uint64_t) from * lb_size - foffset;
for (;;) {
udf_get_adslot(udf_node, slot, &s_ad, &eof);