X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fdb.h;h=acb531f62e25c0cc021a61625bd33dad1c280bfb;hb=23e7583a8c9a0dcee9cbbf3be8bfc453298773f0;hp=399b62fdec391a18d0d87a37fb816f7708887a93;hpb=7c1773cf37ce52958c3287363c0690c591e3c364;p=novacoin.git diff --git a/src/db.h b/src/db.h index 399b62f..acb531f 100644 --- a/src/db.h +++ b/src/db.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_DB_H #define BITCOIN_DB_H @@ -72,8 +72,13 @@ protected: return false; // Unserialize value - CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK, CLIENT_VERSION); - ssValue >> value; + try { + CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK, CLIENT_VERSION); + ssValue >> value; + } + catch (std::exception &e) { + return false; + } // Clear and free memory memset(datValue.get_data(), 0, datValue.get_size());