git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
498a2c9
)
Don't std::advance past beginning of transactions array. Fixes #465
author
Gavin Andresen
<gavinandresen@gmail.com>
Fri, 12 Aug 2011 19:39:12 +0000 (15:39 -0400)
committer
Gavin Andresen
<gavinandresen@gmail.com>
Fri, 12 Aug 2011 19:39:12 +0000 (15:39 -0400)
src/rpc.cpp
patch
|
blob
|
history
diff --git
a/src/rpc.cpp
b/src/rpc.cpp
index
d62a0d9
..
fdb57b3
100644
(file)
--- a/
src/rpc.cpp
+++ b/
src/rpc.cpp
@@
-1188,7
+1188,8
@@
Value listtransactions(const Array& params, bool fHelp)
// Now: iterate backwards until we have nCount items to return:
TxItems::reverse_iterator it = txByTime.rbegin();
- for (std::advance(it, nFrom); it != txByTime.rend(); ++it)
+ if (txByTime.size() > nFrom) std::advance(it, nFrom);
+ for (; it != txByTime.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
if (pwtx != 0)