{"id":231489,"date":"2014-07-29T14:49:02","date_gmt":"2014-07-29T10:49:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=231489"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=231489","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 Bitcoin<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/377\/c24\/1ac\/377c241acf84e067639c95163c2afd46.png\" alt=\"Bitcoin, PVS-Studio\" align=\"right\"\/><br \/>  \u041d\u0438\u0447\u0435\u0433\u043e \u044d\u043f\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Bitcoin. \u041d\u0430\u0448\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u0440\u0443 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442. \u042d\u0442\u043e \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u0443\u043c\u0430\u044e, \u044d\u0442\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u043d\u0438\u0432\u044b\u0439. \u041d\u043e \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438, \u0442\u043e \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0443. \u0422\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u00ab\u0434\u043b\u044f \u0433\u0430\u043b\u043e\u0447\u043a\u0438\u00bb.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0451 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 PVS-Studio \u0438 Clang \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u0417\u0430\u0434\u0430\u0447\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0438 \u0434\u0443\u043c\u0430\u044e \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043c\u044b \u0435\u0451 \u043d\u0435 \u0441\u043a\u043e\u0440\u043e. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<ol>\n<li>\u041d\u0430\u0434\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GCC, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Clang. \u0415\u0441\u043b\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0430 Clang, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0447\u0435\u0441\u0442\u043d\u043e. Clang \u0432 \u043d\u0438\u0445 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0438 \u0443\u0436 \u043f\u043e\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b. \u0410 PVS-Studio \u043d\u0430\u0439\u0434\u0451\u0442.<\/li>\n<li>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 PVS-Studio \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0433\u0440\u0430\u0442\u044c \u043d\u0430 \u0447\u0443\u0436\u043e\u043c \u043f\u043e\u043b\u0435 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abLinux\u00bb. \u041f\u043e\u0447\u0442\u0438 \u043d\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Clang \u0438 Visual Studio. \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e Clang \u0443\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Visual Studio. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0434\u0430. \u041d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b. PVS-Studio \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043b\u043e\u0445\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0432 Linux. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0443\u0434\u0430\u0447\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0431\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430.<\/li>\n<\/ol>\n<p>  \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043b Bitcoin. \u041e\u0431\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0432 \u043d\u0451\u043c \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0448\u043b\u0438. \u042d\u0442\u043e \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u0443\u043c\u0430\u044e, \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0441\u044f \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435 \u0432\u043e\u0439\u0434\u0451\u0442 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u0443\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0445\u043e\u0442\u044f \u0431\u044b \u044d\u0442\u0430 \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430.<\/p>\n<h2>\u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>  \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <a href=\"http:\/\/www.viva64.com\/go.php?url=1410\">Bitcoin<\/a> \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0432\u0437\u044f\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e: <\/p>\n<p>  git clone <a href=\"https:\/\/github.com\/bitcoin\/bitcoin.git\">https:\/\/github.com\/bitcoin\/bitcoin.git<\/a><\/p>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio\/\">PVS-Studio<\/a> \u0432\u0435\u0440\u0441\u0438\u0438 5.17.<\/p>\n<h3>\u0421\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b<\/h3>\n<p>  \u041d\u0430\u0448\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043c\u0435\u0441\u0442\u043e, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u042d\u0442\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0430\u044f\u0441\u044f \u043a \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \u0427\u0442\u043e \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u044f \u043d\u0435 \u0437\u043d\u0430\u044e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u043d\u0430\u0448\u0435\u043b EPIC FAIL. \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0434\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u044d\u043f\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043c\u0435\u043b\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0432\u043e\u0432\u0441\u0435, \u0442\u0430\u043a \u0438 \u0431\u044b\u043b\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e.  <\/p>\n<pre><code class=\"cpp\">bool CCryptoKeyStore::Unlock(const CKeyingMaterial&amp; vMasterKeyIn) {   {     LOCK(cs_KeyStore);     if (!SetCrypted())       return false;      CryptedKeyMap::const_iterator mi = mapCryptedKeys.begin();     for (; mi != mapCryptedKeys.end(); ++mi)     {       const CPubKey &amp;vchPubKey = (*mi).second.first;       const std::vector&lt;unsigned char&gt; &amp;vchCryptedSecret =         (*mi).second.second;       CKeyingMaterial vchSecret;       if(!DecryptSecret(vMasterKeyIn, vchCryptedSecret,                         vchPubKey.GetHash(), vchSecret))           return false;       if (vchSecret.size() != 32)           return false;       CKey key;       key.Set(vchSecret.begin(), vchSecret.end(),               vchPubKey.IsCompressed());       if (key.GetPubKey() == vchPubKey)           break;       return false;     }     vMasterKey = vMasterKeyIn;   }   NotifyStatusChanged(this);   return true; }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V612 An unconditional &#8216;return&#8217; within a loop. crypter.cpp 169<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0446\u0438\u043a\u043b. \u0412 \u043d\u0435\u043c \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043b\u044e\u0447\u0438. \u041d\u043e \u0442\u0435\u043b\u043e \u0446\u0438\u043a\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0446\u0438\u043a\u043b\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u00abreturn false;\u00bb. \u0426\u0438\u043a\u043b \u0442\u0430\u043a\u0436\u0435, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0440\u0432\u0430\u043d \u0434\u043e\u0441\u0440\u043e\u0447\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u00abbreak;\u00bb. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u0442\u0435\u043b\u0435 \u0446\u0438\u043a\u043b\u0430 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u00abcontinue;\u00bb.<\/p>\n<h3>\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0434\u0432\u0438\u0433<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int64_t set_vch(const std::vector&lt;unsigned char&gt;&amp; vch) {   if (vch.empty())     return 0;    int64_t result = 0;   for (size_t i = 0; i != vch.size(); ++i)       result |= static_cast&lt;int64_t&gt;(vch[i]) &lt;&lt; 8*i;    \/\/ If the input vector's most significant byte is 0x80,   \/\/ remove it from the result's msb and return a negative.   if (vch.back() &amp; 0x80)       return -(result &amp; ~(0x80 &lt;&lt; (8 * (vch.size() - 1))));     return result; }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V629 Consider inspecting the &#8216;0x80 &lt;&lt; (8 * (vch.size() \u2014 1))&#8217; expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type. script.h 169<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 64-\u0431\u0438\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041e\u0434\u0438\u043d \u0441\u0434\u0432\u0438\u0433 \u0441\u0434\u0435\u043b\u0430\u043d \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0442.<\/p>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:  <\/p>\n<pre><code class=\"cpp\">static_cast&lt;int64_t&gt;(vch[i]) &lt;&lt; 8*i<\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u0434\u043e int64_t \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0434\u0432\u0438\u0433.<\/p>\n<p>  \u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e:  <\/p>\n<pre><code class=\"cpp\">0x80 &lt;&lt; (8 * (vch.size() - 1))<\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 0x80 \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#8216;int&#8217;. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0434\u0432\u0438\u0433\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 64-\u0431\u0438\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u044f \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0441\u0434\u0432\u0438\u0433\u0438 \u044f \u043f\u0438\u0441\u0430\u043b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &quot;<a href=\"http:\/\/www.viva64.com\/ru\/b\/0142\/\">\u041d\u0435 \u0437\u043d\u0430\u044f \u0431\u0440\u043e\u0434\u0430, \u043d\u0435 \u043b\u0435\u0437\u044c \u0432 \u0432\u043e\u0434\u0443 \u2014 \u0447\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u0442\u044c\u044f<\/a>&quot;.<\/p>\n<p>  \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cpp\">0x80ull &lt;&lt; (8 * (vch.size() - 1))<\/code><\/pre>\n<p>  <\/p>\n<h3>\u041e\u043f\u0430\u0441\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">class CKey {   ....   \/\/ Copy constructor. This is necessary because of memlocking.   CKey(const CKey &amp;secret) : fValid(secret.fValid),                              fCompressed(secret.fCompressed) {     LockObject(vch);     memcpy(vch, secret.vch, sizeof(vch));   }   .... };<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V690 The &#8216;CKey&#8217; class implements a copy constructor, but lacks the the &#8216;=&#8217; operator. It is dangerous to use such a class. key.h 175<\/p>\n<p>  \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e operator =. \u0410 \u044d\u0442\u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 operator = \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0430\u0441\u043d\u043e.<\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0435\u0449\u0451 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432:<\/p>\n<ul>\n<li>V690 The &#8216;Semantic_actions&#8217; class implements the &#8216;=&#8217; operator, but lacks a copy constructor. It is dangerous to use such a class. json_spirit_reader_template.h 196<\/li>\n<li>V690 The &#8216;CFeeRate&#8217; class implements a copy constructor, but lacks the the &#8216;=&#8217; operator. It is dangerous to use such a class. core.h 118<\/li>\n<li>V690 The &#8216;CTransaction&#8217; class implements the &#8216;=&#8217; operator, but lacks a copy constructor. It is dangerous to use such a class. core.h 212<\/li>\n<li>V690 The &#8216;CTxMemPoolEntry&#8217; class implements a copy constructor, but lacks the the &#8216;=&#8217; operator. It is dangerous to use such a class. txmempool.h 27<\/li>\n<li>V690 The &#8216;Json_grammer&#8217; class implements the &#8216;=&#8217; operator, but lacks a copy constructor. It is dangerous to use such a class. json_spirit_reader_template.h 370<\/li>\n<li>V690 The &#8216;Generator&#8217; class implements the &#8216;=&#8217; operator, but lacks a copy constructor. It is dangerous to use such a class. json_spirit_writer_template.h 98<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043d\u0435\u0440\u0432\u043d\u044b\u0445 \u043a\u043b\u0435\u0442\u043e\u043a. \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432 PVS-Studio. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u0448\u044c \u043a\u043e\u0434 \u0438 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e, \u0442\u0435\u0431\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442. \u041a <a href=\"http:\/\/www.viva64.com\/ru\/b\/0222\/\">\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443<\/a> \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u0435\u0448\u044c.<\/p>\n<h2>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Andrey Karpov. <a href=\"http:\/\/www.viva64.com\/en\/b\/0268\/\">http:\/\/www.viva64.com\/en\/b\/0268\/<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441?<\/b><\/p>\n<div class=\"spoiler_text\">\u0427\u0430\u0441\u0442\u043e \u043a \u043d\u0430\u0448\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u0437\u0430\u0434\u0430\u044e\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u041e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u043d\u0438\u0445 \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0437\u0434\u0435\u0441\u044c: <a href=\"http:\/\/www.viva64.com\/ru\/a\/0085\/\">\u041e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e PVS-Studio \u0438 CppCat, \u0432\u0435\u0440\u0441\u0438\u044f 2014<\/a>. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c.  <\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/231489\/\"> http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/231489\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/377\/c24\/1ac\/377c241acf84e067639c95163c2afd46.png\" alt=\"Bitcoin, PVS-Studio\" align=\"right\"\/><br \/>  \u041d\u0438\u0447\u0435\u0433\u043e \u044d\u043f\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Bitcoin. \u041d\u0430\u0448\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u0440\u0443 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442. \u042d\u0442\u043e \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u0443\u043c\u0430\u044e, \u044d\u0442\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u043d\u0438\u0432\u044b\u0439. \u041d\u043e \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438, \u0442\u043e \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0443. \u0422\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u00ab\u0434\u043b\u044f \u0433\u0430\u043b\u043e\u0447\u043a\u0438\u00bb.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-231489","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/231489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=231489"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/231489\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}