From: Jean-Pierre A. <jp...@us...> - 2009-04-25 12:02:29
|
Update of /cvsroot/ntfs-3g/ntfs-3g/libntfs-3g In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13209/ntfs-3g/libntfs-3g Modified Files: Tag: PERMISSION_HANDLING_BRANCH attrib.c Log Message: Secured write position to compressed files Index: attrib.c =================================================================== RCS file: /cvsroot/ntfs-3g/ntfs-3g/libntfs-3g/attrib.c,v retrieving revision 1.22.2.30 retrieving revision 1.22.2.31 diff -u -d -r1.22.2.30 -r1.22.2.31 --- attrib.c 8 Apr 2009 19:15:29 -0000 1.22.2.30 +++ attrib.c 25 Apr 2009 12:02:20 -0000 1.22.2.31 @@ -1502,7 +1502,8 @@ goto err_out; } if (compressed) { - while (ofs >= (rl->length << vol->cluster_size_bits)) { + while (rl->length + && (ofs >= (rl->length << vol->cluster_size_bits))) { ofs -= rl->length << vol->cluster_size_bits; rl++; } @@ -1778,7 +1779,8 @@ if (ntfs_attr_fill_hole(na, (s64)0, &ofs, &rl, &update_from)) goto err_out; } - while (ofs >= (rl->length << vol->cluster_size_bits)) { + while (rl->length + && (ofs >= (rl->length << vol->cluster_size_bits))) { ofs -= rl->length << vol->cluster_size_bits; rl++; } |