git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
dfd0524
)
BUGFIX: Don't try to resize vector to negative size.
author
alex
<alex@alex-VirtualBox.(none)>
Sun, 28 Jul 2013 23:18:17 +0000 (
03:18
+0400)
committer
alex
<alex@alex-VirtualBox.(none)>
Sun, 28 Jul 2013 23:18:17 +0000 (
03:18
+0400)
src/db.cpp
patch
|
blob
|
history
diff --git
a/src/db.cpp
b/src/db.cpp
index
4d4d278
..
e6f66ca
100644
(file)
--- a/
src/db.cpp
+++ b/
src/db.cpp
@@
-963,6
+963,8
@@
bool CAddrDB::Read(CAddrMan& addr)
// use file size to size memory buffer
int fileSize = GetFilesize(filein);
int dataSize = fileSize - sizeof(uint256);
+ //Don't try to resize to a negative number if file is small
+ if ( dataSize < 0 ) dataSize = 0;
vector<unsigned char> vchData;
vchData.resize(dataSize);
uint256 hashIn;