From 219d3532264ed70547b7447acdf5984c19b45c0b Mon Sep 17 00:00:00 2001 From: Yura Pakhuchiy Date: Tue, 4 Sep 2007 17:20:13 +0300 Subject: [PATCH] Fix corner case in hole instantiating in ntfs_attr_pwrite(). (Szaka) --- libntfs/attrib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libntfs/attrib.c b/libntfs/attrib.c index 2fc0f6d1..acd897db 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -1260,6 +1260,8 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, const void *b) if (rlc->lcn >= 0) { lcn_seek_from = rlc->lcn - (rlc->vcn - from_vcn); + if (lcn_seek_from < -1) + lcn_seek_from = -1; break; } }