2001-07-22 20:12:42

by Anton Altaparmakov

[permalink] [raw]
Subject: [PATCH] 2.4.7 tiny NTFS fix

Linus,

Please apply below patch (this time properly inlined I hope). It is
against 2.4.7-pre8 but should apply cleanly to 2.4.7. It adds a return
value check.

Thanks to Rasmus Andersen for initial patch.

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/

------ cut here ------
--- linux-2.4.7-pre8-vanilla/fs/ntfs/dir.c.old Sun Jul 22 21:03:08 2001
+++ linux-2.4.7-pre8-vanilla/fs/ntfs/dir.c Sun Jul 22 21:02:59 2001
@@ -894,6 +894,11 @@
return -EIO;
}
attr = ntfs_find_attr(ino, vol->at_index_allocation, I30);
+ if (!attr) {
+ ntfs_free(buf);
+ ntfs_debug(DEBUG_DIR3, "unsorted 9.5\n");
+ return -EIO;
+ }
while (1) {
if ((__s64)*p_high << vol->cluster_size_bits > attr->size) {
/* No more index records. */