{"id":262344,"date":"2015-07-27T14:04:02","date_gmt":"2015-07-27T10:04:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=262344"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=262344","title":{"rendered":"\u041d\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 gcc 5.1"},"content":{"rendered":"<p>     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/daa\/c21\/c19\/daac21c1959343eea2bd68ee5ed63d54.jpg\" align=\"right\"\/>\u0425\u043e\u0440\u043e\u0448\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 gcc \u2014 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 gcc 5.1 \u0438 \u0432\u044b\u0448\u0435 \u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">void something( char arr[100] ) {     \/\/ this loop is broken     for( size_t index = 0; index &lt; sizeof(arr)\/sizeof(arr[0]); index++ ) {        \/\/WHATEVER    } }<\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 C \u0438 C++ \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0442\u0438\u043f\u0430 <i>char*<\/i>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <i>sizeof(arr)<\/i> \u0434\u0430\u0441\u0442 \u0442\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0438 <i>sizeof(char*)<\/i> \u2013 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, 4 \u0438\u043b\u0438 8. \u0426\u0438\u043a\u043b, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c.<br \/>  \u0414\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cpp\">void something( char encryptionKey[9000] ) {    \/\/ WHATEVER, PROFIT    \/\/ this call is broken   SecureZeroMemory( encryptionKey, sizeof(encryptionKey)); \/\/ erase they key }<\/code><\/pre>\n<p>  \u0437\u0434\u0435\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0445\u043e\u0442\u0435\u043b\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/abbyy\/blog\/127259\/\">\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0443\u043b\u044f\u043c\u0438 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435<\/a>, \u043d\u043e \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442. \u0422\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043d\u0430\u0439\u0442\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0447\u0435\u043c \u043f\u0435\u0440\u0432\u0443\u044e.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0449\u0435, \u0432 gcc 5.1 \u0438 \u043d\u043e\u0432\u0435\u0435 \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435, \u0438 \u043e\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<a name=\"habracut\"><\/a><\/p>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0443\u0436\u0435 \u0441\u043f\u0435\u0448\u0430\u0442 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043a\u0440\u0438\u0432\u0438\u0437\u043d\u0435 \u0440\u0443\u043a \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432\u044b\u0448\u0435. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f, \u0447\u0442\u043e \u0432 C++ \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u043e\u043a\u0443\u0441 (<a href=\"http:\/\/blogs.msdn.com\/b\/the1\/archive\/2004\/05\/07\/128242.aspx\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>) \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">template&lt;typename StoredType, size_t Size&gt; char ( &ArrayElementsCountHelper(StoredType( &Array )[Size]) )[Size]; #define countOfElements(Array) sizeof(ArrayElementsCountHelper (Array)) <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <i>countOfElements()<\/i> \u0432 \u043a\u043e\u0434\u0435 \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0437\u0430\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">    char arr[100]     for( size_t index = 0; index &lt; countOfElements(arr); index++ ) {        \/\/WHATEVER }<\/code><\/pre>\n<p>  \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u2122.<\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f <i>sizeof(smth)\/sizeof(smth[0])<\/i> \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043c\u0430\u043a\u0440\u043e\u0441:<\/p>\n<pre><code class=\"cpp\">\/\/ in a header far, far away... #define errorProneCountOfElements( arr ) (sizeof(arr)\/sizeof((arr)[0]))  for( size_t index = 0; index &lt; errorProneCountOfElements (arr); index++ ) {        \/\/WHATEVER }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445. \u041f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u043d\u0430 <a href=\"http:\/\/gcc.godbolt.org\">gcc.godbolt.org<\/a><\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 gcc 4.9.2 \u2013 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043e \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432. \u041f\u043e\u0442\u043e\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 gcc 5.1.0 \u2013 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0441 \u0446\u0438\u043a\u043b\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u0446\u0438\u043a\u043b\u0430<\/p>\n<p>  <i>warning: &#8216;sizeof&#8217; on array function parameter &#8216;arr&#8217; will return size of &#8216;char*&#8217; [-Wsizeof-array-argument]<\/i><\/p>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u043c \u043a\u043e\u0434\u0435:  <\/p>\n<pre><code class=\"cpp\">void somethingExplicitCount( char arr[] ) {     for( size_t index = 0; index &lt; sizeof(arr)\/sizeof(arr[0]); index++ ) {        \/\/WHATEVER    } }<\/code><\/pre>\n<p>  \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u043e \u0436\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0432 \u043a\u043e\u0434\u0435 \u0441 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u043c:  <\/p>\n<pre><code class=\"cpp\">void somethingMacroCount( char arr[9000] ) {     for( size_t index = 0; index &lt; errorProneCountOfElements(arr); index++ ) {        \/\/WHATEVER, PROFIT    } }<\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0441 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0442\u043e\u0436\u0435 \u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u044b\u0439 <i>memset()<\/i> \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438):  <\/p>\n<pre><code class=\"cpp\">void somethingMemset( char key[9000] ) {     \/\/WHATEVER, PROFIT     memset(key, 0, sizeof(key)); \/\/ don't use memset for sensitive data }<\/code><\/pre>\n<p>  \u041f\u0420\u0418\u0411\u042b\u041b\u042c.<\/p>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e clang \u0432\u0435\u0440\u0441\u0438\u0438 3.0 \u0443\u0436\u0435 \u0443\u043c\u0435\u043b \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u041e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0431\u043b\u043e\u0433\u0435 LLVM <a href=\"http:\/\/blog.llvm.org\/2013\/09\/clang-warnings.html\">\u0431\u044b\u043b\u043e \u043d\u0435\u043a\u043e\u0433\u0434\u0430 \u0441\u043a\u0430\u0437\u0430\u043d\u043e<\/a>, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0435 \u0434\u043b\u044f clang \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 gcc \u0442\u0430\u043a \u043d\u0435 \u0443\u043c\u0435\u0435\u0442\u2122. NO MOAR.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  <i>\u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u041c\u0435\u0449\u0435\u0440\u044f\u043a\u043e\u0432,<br \/>  \u0434\u0435\u043f\u0430\u0440\u0442\u0430\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/i>     \t<\/p>\n<div class=\"clear\"><\/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\/post\/263609\/\"> http:\/\/habrahabr.ru\/post\/263609\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/daa\/c21\/c19\/daac21c1959343eea2bd68ee5ed63d54.jpg\" align=\"right\"\/>\u0425\u043e\u0440\u043e\u0448\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 gcc \u2014 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 gcc 5.1 \u0438 \u0432\u044b\u0448\u0435 \u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">void something( char arr[100] ) {     \/\/ this loop is broken     for( size_t index = 0; index &lt; sizeof(arr)\/sizeof(arr[0]); index++ ) {        \/\/WHATEVER    } }<\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 C \u0438 C++ \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0442\u0438\u043f\u0430 <i>char*<\/i>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <i>sizeof(arr)<\/i> \u0434\u0430\u0441\u0442 \u0442\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0438 <i>sizeof(char*)<\/i> \u2013 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, 4 \u0438\u043b\u0438 8. \u0426\u0438\u043a\u043b, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c.<br \/>  \u0414\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cpp\">void something( char encryptionKey[9000] ) {    \/\/ WHATEVER, PROFIT    \/\/ this call is broken   SecureZeroMemory( encryptionKey, sizeof(encryptionKey)); \/\/ erase they key }<\/code><\/pre>\n<p>  \u0437\u0434\u0435\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0445\u043e\u0442\u0435\u043b\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/abbyy\/blog\/127259\/\">\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0443\u043b\u044f\u043c\u0438 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435<\/a>, \u043d\u043e \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442. \u0422\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043d\u0430\u0439\u0442\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0447\u0435\u043c \u043f\u0435\u0440\u0432\u0443\u044e.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0449\u0435, \u0432 gcc 5.1 \u0438 \u043d\u043e\u0432\u0435\u0435 \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435, \u0438 \u043e\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/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-262344","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/262344","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=262344"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/262344\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=262344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=262344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=262344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}