* StreamReader::ReadAt(): Passed incorrect size to _ReadDirectItem(), which

could cause a memory read access beyond the block, resulting in a crash, if
  nothing was mapped there.
* Automatic white space cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35915 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-03-19 18:11:32 +00:00
parent f0330c4aff
commit 02cb896640

View File

@ -1,6 +1,6 @@
// Iterators.h
//
// Copyright (c) 2003, Ingo Weinhold (bonefish@cs.tu-berlin.de)
// Copyright (c) 2003-2010, Ingo Weinhold (bonefish@cs.tu-berlin.de)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -19,7 +19,9 @@
// You can alternatively use *this file* under the terms of the the MIT
// license included in this package.
#include "Iterators.h"
#include "Block.h"
#include "BlockCache.h"
#include "Key.h"
@ -27,6 +29,7 @@
#include "StatItem.h"
#include "Tree.h"
// min and max
// We don't want to include <algobase.h> otherwise we also get <iostream.h>
// and other undesired things.
@ -1340,7 +1343,7 @@ StreamReader::ReadAt(off_t position, void *buffer, size_t bufferSize,
error = _ReadIndirectItem(inItemOffset, buffer, toRead);
break;
case TYPE_DIRECT:
error = _ReadDirectItem(inItemOffset, buffer, bufferSize);
error = _ReadDirectItem(inItemOffset, buffer, toRead);
break;
case TYPE_STAT_DATA:
case TYPE_DIRENTRY: