Changes by: flatcap
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9802
Modified Files:
runlist.c
Log Message:
bug fix - reading uninitialised memory
Index: runlist.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/runlist.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -p -r1.52 -r1.53
--- runlist.c 6 Jul 2005 22:47:18 -0000 1.52
+++ runlist.c 13 Sep 2005 12:51:34 -0000 1.53
@@ -1,8 +1,8 @@
-/*
+/**
* runlist.c - Run list handling code. Part of the Linux-NTFS project.
*
* Copyright (c) 2002-2005 Anton Altaparmakov
- * Copyright (c) 2002 Richard Russon
+ * Copyright (c) 2002-2005 Richard Russon
* Copyright (c) 2004 Yura Pakhuchiy
*
* This program/include file is free software; you can redistribute it and/or
@@ -52,7 +52,7 @@ static __inline__ void ntfs_rl_mm(runlis
/**
* Internal:
*
- * rl_mc - runlist memory copy
+ * ntfs_rl_mc - runlist memory copy
*/
static __inline__ void ntfs_rl_mc(runlist_element *dstbase, int dst,
runlist_element *srcbase, int src, int size)
@@ -381,7 +381,7 @@ static __inline__ runlist_element *ntfs_
ntfs_rl_mc(dst, loc, src, left, ssize - left);
/* We may have changed the length of the file, so fix the end marker */
- if (dst[magic].lcn == LCN_ENOENT)
+ if (((dsize - loc - right - 1) > 0) && (dst[magic].lcn == LCN_ENOENT))
dst[magic].vcn = dst[magic - 1].vcn + dst[magic - 1].length;
return dst;
}
|