From a2dab6b2ff4d512a235df049fb4b8bc60e147734 Mon Sep 17 00:00:00 2001 From: jpandre Date: Sun, 3 Aug 2008 07:20:58 +0000 Subject: [PATCH] Fixed possible overflows in reading the user mapping file --- libntfs-3g/security.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libntfs-3g/security.c b/libntfs-3g/security.c index 13559110..9e5aa832 100644 --- a/libntfs-3g/security.c +++ b/libntfs-3g/security.c @@ -4233,11 +4233,10 @@ static struct MAPLIST *getmappingitem( while ((src < *psize) && (buf[src] != '\n')) { if (dst < LINESZ) - item->maptext[dst] = buf[src]; - dst++; + item->maptext[dst++] = buf[src]; src++; } - if (buf[src] != '\n') { + if ((src >= *psize) && (buf[src] != '\n')) { *poffs += *psize; if (ni) *psize = ntfs_local_read(ni,