{"id":334887,"date":"2022-06-23T15:00:39","date_gmt":"2022-06-23T15:00:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=334887"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=334887","title":{"rendered":"<span>\u0412 \u043c\u0438\u0440\u0435 \u0430\u043d\u0442\u0440\u043e\u043f\u043e\u043c\u043e\u0440\u0444\u043d\u044b\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445: PVS-Studio \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b Overgrowth<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b\u043b \u043e\u0442\u043a\u0440\u044b\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0433\u0440\u044b Overgrowth. \u041c\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0435\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0433\u0434\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u044d\u043a\u0448\u0435\u043d\u0430: \u0432 \u0438\u0433\u0440\u0435 \u0438\u043b\u0438 \u0432 \u0435\u0451 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6d7\/ffb\/b79\/6d7ffbb79748a926da458b5004cc8ee0.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d7\/ffb\/b79\/6d7ffbb79748a926da458b5004cc8ee0.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p>Overgrowth \u2013 \u0432\u044b\u0448\u0435\u0434\u0448\u0430\u044f 14 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0438\u0433\u0440\u0430 \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Wolfire Games. \u042d\u0442\u043e \u044d\u043a\u0448\u0435\u043d \u0441 \u0432\u0438\u0434\u043e\u043c \u043e\u0442 3-\u0433\u043e \u043b\u0438\u0446\u0430, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u0440\u0430\u0447\u043d\u043e\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u0432\u0435\u043a\u043e\u0432\u043e\u043c \u043c\u0438\u0440\u0435 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445 \u0441 \u043f\u043e\u0432\u0430\u0434\u043a\u0430\u043c\u0438 \u043b\u044e\u0434\u0435\u0439. \u0412 \u0438\u0433\u0440\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u0418\u0418. \u0412 \u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u043a\u0443 \u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u0430\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u041f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0440\u0435\u0436\u0438\u043c.<\/p>\n<p>Overgrowth \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u0434\u0432\u0438\u0436\u043a\u0435 Phoenix. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f. \u0411\u0435\u0433, \u043f\u0440\u044b\u0436\u043a\u0438, \u043f\u0435\u0440\u0435\u043a\u0430\u0442\u044b, \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043f\u043b\u0430\u0432\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0435 \u043f\u043e\u0437\u044b \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u0436\u0435 \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430. \u041d\u0430 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0438\u0433\u0440\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0433\u043e\u0434\u0430, \u0434\u0430\u0436\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0442\u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u0434 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u044b\u043c\u0438 \u043b\u0443\u0447\u0430\u043c\u0438.<\/p>\n<p>\u0410\u043d\u043e\u043d\u0441 Overgrowth \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0451\u043b 17 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f 2008 \u0433\u043e\u0434\u0430, \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0438\u0433\u0440\u044b \u0432\u044b\u0448\u043b\u0430 16 \u043e\u043a\u0442\u044f\u0431\u0440\u044f 2017 \u0433\u043e\u0434\u0430.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u044f\u0442, \u044f \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0435\u0439: <a href=\"https:\/\/github.com\/WolfireGames\/overgrowth\/tree\/f2a67f79e3205a45bd90ed5021276b9e6aa86132\">f2a67f7<\/a>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0441\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 PVS-Studio.<\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N1, N2<\/h4>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 PVS-Studio \u0432\u044b\u0434\u0430\u043b \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v611\/\">V611<\/a> [CERT-MEM51-CPP] The memory was allocated using &#8216;new T[]&#8217; operator but was released using the &#8216;delete&#8217; operator. Consider inspecting this code. It&#8217;s probably better to use &#8216;delete [] heightfieldData;&#8217;. PhysicsServerCommandProcessor.cpp 4741<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v773\/\">V773<\/a> [CERT-MEM31-C, CERT-MEM51-CPP] The function was exited without releasing the &#8216;worldImporter&#8217; pointer. A memory leak is possible. PhysicsServerCommandProcessor.cpp 4742<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   btMultiBodyWorldImporter* worldImporter = new btMultiBodyWorldImporter(....);   ....   const unsigned char* heightfieldData = 0;   ....   heightfieldData = new unsigned char[width * height * sizeof(btScalar)];   ....   delete heightfieldData;   return ....; } <\/code><\/pre>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0438\u0441\u0430\u043b \u0434\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0432 \u0421++.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v773\/\">V773<\/a>, \u043a\u0430\u043a \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e. \u041f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>worldImporter<\/em> \u0431\u044b\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>new<\/em> \u0438 \u043f\u043e \u0432\u044b\u0445\u043e\u0434\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u0431\u044b\u043b\u0430 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0430. \u042d\u0442\u043e \u043f\u043b\u043e\u0445\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0442\u0435\u0447\u043a\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b, \u043f\u043e\u0437\u0432\u0430\u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>delete<\/em> \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u0438\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044e <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v611\/\">V611<\/a> \u0438 \u0431\u0443\u0444\u0435\u0440\u0443 <em>heightfieldData<\/em>. \u0422\u0443\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u043e\u0434\u043d\u0430\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431 \u043f\u043e\u0437\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>delete[]<\/em> \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u043d\u0435\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>new[]<\/em>, \u043e\u043d \u043f\u043e\u0437\u0432\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <em>delete<\/em>. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0432\u043e\u0442 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4861\/expr.delete#2\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0443\u043d\u043a\u0442.<\/p>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   btMultiBodyWorldImporter* worldImporter = new btMultiBodyWorldImporter(....);   ....   const unsigned char* heightfieldData = 0;   ....   heightfieldData = new unsigned char[width * height * sizeof(btScalar)];   ....    delete   worldImporter;   delete[] heightfieldData;   return ....; } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0440\u0443\u0447\u043d\u043e\u0439 \u043e\u0447\u0438\u0441\u0442\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043a\u043e\u0434 \u043f\u043e\u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 <em>std::unique_ptr<\/em> \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0440\u043e\u0447\u0435 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u0435\u0435. \u041e\u043d \u0437\u0430\u0449\u0438\u0442\u0438\u0442 \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0451\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u0434\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u043c \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   auto worldImporter = std::make_unique&lt;btMultiBodyWorldImporter> ();   ....   std::unique_ptr&lt;unsigned char[]> heightfieldData;   ....   heightfieldData = std::make_unique_for_overwrite&lt;unsigned char[]>                                 (width * height * sizeof(btScalar));   ....   return ....; } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N3<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v772\/\">V772<\/a> [CERT-MSC15-C] Calling a &#8216;delete&#8217; operator for a void pointer will cause undefined behavior. OVR_CAPI_Util.cpp 380<\/p>\n<pre><code class=\"cpp\">typedef struct ovrHapticsClip_ {   const void* Samples;   .... } ovrHapticsClip; ....  OVR_PUBLIC_FUNCTION(void) ovr_ReleaseHapticsClip(ovrHapticsClip* hapticsClip) {   if (hapticsClip != NULL &amp;&amp; hapticsClip->Samples != NULL)    {     delete[] hapticsClip->Samples;   ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <em>delete<\/em> \u0438 <em>delete[]<\/em> \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 void \u0432\u0435\u0434\u0451\u0442 \u043a <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4861\/expr.delete#footnote-73\">\u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e<\/a>. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043a \u0435\u0433\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u043f\u0440\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0433\u043b\u0443\u0431\u043e\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u044f \u043f\u0440\u043e\u0432\u0451\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u041f\u043e\u043b\u0435 <em>Samples<\/em> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u0442\u0438\u043f\u043e\u043c <em>uint8_t*<\/em>. \u0412\u043e\u0442 \u043f\u0440\u0443\u0444:<\/p>\n<pre><code class=\"cpp\">.... ovr_GenHapticsFromAudioData(ovrHapticsClip* outHapticsClip, ....) {   ....   uint8_t* hapticsSamples = new uint8_t[hapticsSampleCount];   ....    outHapticsClip->Samples = hapticsSamples;    .... } <\/code><\/pre>\n<p>\u042d\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e\u0431 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u043d\u044c\u0448\u0435 \u043e\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0438 \u044d\u0442\u043e \u0443\u0431\u0440\u0430\u043b\u0438 \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u043f\u043e\u043b\u044f <em>Samples<\/em> \u0441 <em>void*<\/em> \u043d\u0430 <em>uint8_t*<\/em> \u0437\u0430\u0431\u044b\u043b\u0438.<\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430 \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e, \u043e\u043d \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0438 \u0432\u0435\u0434\u0451\u0442 \u043a UB.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N4<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v595\/\">V595<\/a> [CERT-EXP12-C] The &#8216;ctx&#8217; pointer was utilized before it was verified against nullptr. Check lines: 130, 131. ascontext.cpp 130<\/p>\n<pre><code class=\"cpp\">class ASContext { public:   asIScriptContext *ctx; }  ASContext::ASContext(....) {   ctx = ....;   ctx->SetUserData(this, 0);   if( ctx == 0 )    {     FatalError(\"Error\",\"Failed to create the context.\");     return;   }   .... } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>ctx<\/em> \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>0<\/em>. \u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u043f\u0430\u0441\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <em>ctx<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u0435\u043d <em>nullptr<\/em>, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">ASContext::ASContext(....) {   ctx = ....;   if( !ctx )   {     FatalError(\"Error\",\"Failed to create the context.\");     return;   }    ctx->SetUserData(this, 0);   .... } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N5<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;connect_id_ == &#8212; 1&#8217; is always true. placeholderobject.cpp 342<\/p>\n<pre><code class=\"cpp\">class PlaceholderObject { private:   int connect_id_;   .... };  ObjectSanityState PlaceholderObject::GetSanity() {   ....   if( .... &amp;&amp; connect_id_ == -1)    {     if( connect_id_ == -1)      {       ....     }    }    .... } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 <em>connect_id_ == -1<\/em>. \u041e\u043d\u0430 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>connect_id_<\/em> \u0441 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0430\u0441\u044c.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0430\u044f-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430 \u0438 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">ObjectSanityState PlaceholderObject::GetSanity() {   ....   if( .... &amp;&amp; connect_id_ == -1 )    {       ....   }    .... } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N6<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v791\/\">V791<\/a> The initial value of the index in the nested loop equals &#8216;i&#8217;. Perhaps, &#8216;i + 1&#8217; should be used instead. navmeshhintobject.cpp 65<\/p>\n<pre><code class=\"cpp\">NavmeshHintObject::NavmeshHintObject() {   ....   for( int i = 0; i &lt; 8; i++ )   {     for( int k = i; k &lt; 8; k++ )     {       if( i != k )       {         if(              corners[i][0] == corners[k][0] ||             corners[i][1] == corners[k][1] ||             corners[i][2] == corners[k][2]            )           {             cross_marking.push_back(corners[i]);                cross_marking.push_back(corners[k]);              }       }     }   }   .... } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u044f\u0432\u0438\u043b \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0446\u0438\u043a\u043b. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043a\u043e\u0434\u0430 \u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u0430\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0430\u0440\u044b, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <em>i == j<\/em>. \u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">NavmeshHintObject::NavmeshHintObject() {   ....   for( int i = 0; i &lt; 8; i++ )   {     for( int k = i + 1; k &lt; 8; k++ )     {       if(            corners[i][0] == corners[k][0] ||           corners[i][1] == corners[k][1] ||           corners[i][2] == corners[k][2]          )         {           cross_marking.push_back(corners[i]);              cross_marking.push_back(corners[k]);            }     }   }   .... } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N7<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v561\/\">V561<\/a> [CERT-DCL01-C] It&#8217;s probably better to assign value to &#8216;other_radius_sq&#8217; variable than to declare it anew. Previous declaration: scenegraph.cpp, line 2006. scenegraph.cpp 2010<\/p>\n<pre><code class=\"cpp\">bool SceneGraph::AddDynamicDecal(....) {   ....   float other_radius_sq = ....;   if(....)   {     ....     float other_radius_sq = ....;   }   .... } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>other_radius_sq<\/em>. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u2014 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N8, N9<\/h4>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;imageBits == 8&#8217; is always false. texture_data.cpp 305<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;imageBits == 24&#8217; is always false. texture_data.cpp 313<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">void TextureData::GetUncompressedData(unsigned char* data)  {   int imageBits = 32;   ....   if (imageBits == 8)   {     ....   }   else if (imageBits == 24)   {     ....   }   .... } <\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>imageBits<\/em> \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u044f\u0432\u0438\u043b \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0438\u043b\u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N10, N11<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v769\/\">V769<\/a> [CERT-EXP08-C] The &#8216;idx_buffer_offset&#8217; pointer in the &#8216;idx_buffer_offset += pcmd->ElemCount&#8217; expression equals nullptr. The resulting value is senseless and it should not be used. imgui_impl_sdl_gl3.cpp 138<\/p>\n<pre><code class=\"cpp\">void ImGui_ImplSdlGL3_RenderDrawLists(ImDrawData* draw_data) {   const ImDrawIdx* idx_buffer_offset = 0;   ....   idx_buffer_offset += pcmd->ElemCount;   .... } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u0443\u044e \u043a \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u0430\u043b\u0435\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0414\u0430 \u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412 \u043e\u0431\u0449\u0435\u043c, \u044d\u0442\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v769\/\">V769<\/a> [CERT-EXP08-C] The &#8216;cp&#8217; pointer in the &#8216;cp ++&#8217; expression equals nullptr. The resulting value is senseless and it should not be used. crn_file_utils.cpp 547<\/p>\n<pre><code class=\"cpp\">int file_utils::wildcmp(...., const char* pString) {   const char* cp = NULL;   ....   pString = cp++;   .... } <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438\u043b\u0438 \u043a\u0440\u0438\u0432\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u0427\u0442\u043e \u0438\u043c\u0435\u043b\u0438 \u0432 \u0432\u0438\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u2014 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0430\u0434\u0430\u0442\u044c&#8230;<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N12<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v523\/\">V523<\/a> The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. skeleton.cpp 152<\/p>\n<pre><code class=\"cpp\">void Skeleton::SetGravity( bool enable )  {   if(enable)   {     for(unsigned i=0; i&lt;physics_bones.size(); i++)     {       if(!physics_bones[i].bullet_object)       {         continue;       }       physics_bones[i].bullet_object->SetGravity(true);       \/\/physics_bones[i].bullet_object->SetDamping(0.0f);     }   }    else    {     for(unsigned i=0; i&lt;physics_bones.size(); i++)     {       if(!physics_bones[i].bullet_object)       {         continue;       }       physics_bones[i].bullet_object->SetGravity(true);       \/\/physics_bones[i].bullet_object->SetDamping(1.0f);     }   } } <\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043e\u0431\u0437\u043e\u0440\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b <em>if<\/em> \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 <em>then<\/em> \u0438 <em>else<\/em>. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0434\u043e\u043f\u0438\u0441\u0430\u043b \u0432\u0442\u043e\u0440\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u041e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0443\u0434\u0438\u0442\u044c \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c \u0432 \u0432\u0435\u0442\u043a\u0430\u0445 \u043a\u043e\u0434\u0430.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N13<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v728\/\">V728<\/a> An excessive check can be simplified. The &#8216;(A &amp;&amp; !B) || (!A &amp;&amp; B)&#8217; expression is equivalent to the &#8216;bool(A) != bool(B)&#8217; expression. as_compiler.cpp 4317<\/p>\n<pre><code class=\"cpp\">void asCCompiler::CompileIfStatement(....) {   bool constructorCall1 = ....;   bool constructorCall2 = ....;   ....   if (  (constructorCall1 &amp;&amp; !constructorCall2)        ||(constructorCall2 &amp;&amp; !constructorCall1) )   {     ....   } } <\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043c\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u044d\u0442\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430. \u041e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430 \u0438 \u0438\u0437\u044f\u0449\u043d\u0430.<\/p>\n<p>PVS-Studio \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u2014 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u0435\u0435. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0451\u043b \u0432\u044b\u0437\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 <em>XOR<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 C++ \u043d\u0435\u0442 <em>\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0433\u043e &#171;\u0418\u041b\u0418&#187;<\/em> \u0434\u043b\u044f \u0442\u0438\u043f\u0430 <em>bool<\/em>, \u0438 \u043f\u043e\u0440\u043e\u0439 \u044d\u0442\u043e \u0432\u044b\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u0439 \u043a\u043e\u0434. \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">void asCCompiler::CompileIfStatement(....) {   bool constructorCall1 = ....;   bool constructorCall2 = ....;   ....   if (constructorCall1 != constructorCall2)   {     ....   } } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N14, N15, N16<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v610\/\">V610<\/a> [CERT-INT34-C] Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand (&#8216;i&#8217; = [0..63]) is greater than or equal to the length in bits of the promoted left operand. bitarray.cpp 77<\/p>\n<pre><code class=\"cpp\">class Bitarray  { private:   uint64_t *arr;   .... };  void Bitarray::SetBit( size_t index ) {   size_t p = index\/64;   size_t i = index%64;    arr[p] |= (1UL &lt;&lt; i); } <\/code><\/pre>\n<p>PVS-Studio \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u043c \u0432\u043b\u0435\u0432\u043e \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443, \u044d\u0442\u043e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043b\u0435\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430. \u041b\u0438\u0442\u0435\u0440\u0430\u043b <em>1UL<\/em> \u043f\u043e\u0434 <em>MSVC<\/em> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d <em>32<\/em> \u0431\u0438\u0442\u0430\u043c\u0438, \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0436\u0435 \u043b\u0435\u0436\u0438\u0442 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 <em>0<\/em> \u0434\u043e <em>63<\/em>.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u0434 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0434 Windows, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e. \u0412\u043e\u0442 \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v610\/\">V610<\/a> [CERT-INT34-C] Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand (&#8216;i&#8217; = [0..63]) is greater than or equal to the length in bits of the promoted left operand. bitarray.cpp 85<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v610\/\">V610<\/a> [CERT-INT34-C] Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand (&#8216;i&#8217; = [0..63]) is greater than or equal to the length in bits of the promoted left operand. bitarray.cpp 93<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N17<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v751\/\">V751<\/a> [CERT-MSC13-C] Parameter &#8216;rayTo&#8217; is not used inside function body. btSoftBody.cpp 2148<\/p>\n<pre><code class=\"cpp\">btScalar btSoftBody::RayFromToCaster::rayFromToTriangle(   const btVector3&amp; rayFrom,   const btVector3&amp; rayTo,   const btVector3&amp; rayNormalizedDirection,   const btVector3&amp; a,   const btVector3&amp; b,   const btVector3&amp; c,   btScalar maxt) {   static const btScalar ceps = -SIMD_EPSILON * 10;   static const btScalar teps = SIMD_EPSILON * 10;    const btVector3 n = btCross(b - a, c - a);   const btScalar d = btDot(a, n);   const btScalar den = btDot(rayNormalizedDirection, n);   if (!btFuzzyZero(den))   {     const btScalar num = btDot(rayFrom, n) - d;     const btScalar t = -num \/ den;     if ((t > teps) &amp;&amp; (t &lt; maxt))     {       const btVector3 hit = rayFrom + rayNormalizedDirection * t;       if ((btDot(n, btCross(a - hit, b - hit)) > ceps) &amp;&amp;           (btDot(n, btCross(b - hit, c - hit)) > ceps) &amp;&amp;           (btDot(n, btCross(c - hit, a - hit)) > ceps))       {         return (t);       }     }   }   return (-1); } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <em>rayTo<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>rayFrom<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0438\u043b\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0430\u0447\u043d\u043e\u043c \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0448\u0451\u043b \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430: \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u041c\u044b \u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Overgrowth \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0434\u043e\u0447\u0451\u0442\u044b, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0437\u0430\u0445\u043e\u0442\u044f\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 PVS-Studio. \u042d\u0442\u043e \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u0433\u0440\u0435 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u0445 \u0444\u0430\u043d\u0430\u0442\u043e\u0432 \u0432 \u0443\u0436\u0435 \u043d\u043e\u0432\u044b\u0445, \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u043d\u044b\u0445 \u0431\u0430\u0433\u0430\u043c \u0441\u0431\u043e\u0440\u043a\u0430\u0445 \ud83d\ude42<\/p>\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: <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0957\/\">In the world of anthropomorphic animals: PVS-Studio checks Overgrowth<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/673090\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/673090\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b\u043b \u043e\u0442\u043a\u0440\u044b\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0433\u0440\u044b Overgrowth. \u041c\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0435\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0433\u0434\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u044d\u043a\u0448\u0435\u043d\u0430: \u0432 \u0438\u0433\u0440\u0435 \u0438\u043b\u0438 \u0432 \u0435\u0451 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435!<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p>Overgrowth \u2013 \u0432\u044b\u0448\u0435\u0434\u0448\u0430\u044f 14 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0438\u0433\u0440\u0430 \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Wolfire Games. \u042d\u0442\u043e \u044d\u043a\u0448\u0435\u043d \u0441 \u0432\u0438\u0434\u043e\u043c \u043e\u0442 3-\u0433\u043e \u043b\u0438\u0446\u0430, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u0440\u0430\u0447\u043d\u043e\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u0432\u0435\u043a\u043e\u0432\u043e\u043c \u043c\u0438\u0440\u0435 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445 \u0441 \u043f\u043e\u0432\u0430\u0434\u043a\u0430\u043c\u0438 \u043b\u044e\u0434\u0435\u0439. \u0412 \u0438\u0433\u0440\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u0418\u0418. \u0412 \u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u043a\u0443 \u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u0430\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u041f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0440\u0435\u0436\u0438\u043c.<\/p>\n<p>Overgrowth \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u0434\u0432\u0438\u0436\u043a\u0435 Phoenix. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f. \u0411\u0435\u0433, \u043f\u0440\u044b\u0436\u043a\u0438, \u043f\u0435\u0440\u0435\u043a\u0430\u0442\u044b, \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043f\u043b\u0430\u0432\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0435 \u043f\u043e\u0437\u044b \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u0436\u0435 \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430. \u041d\u0430 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0438\u0433\u0440\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0433\u043e\u0434\u0430, \u0434\u0430\u0436\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0442\u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u0434 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u044b\u043c\u0438 \u043b\u0443\u0447\u0430\u043c\u0438.<\/p>\n<p>\u0410\u043d\u043e\u043d\u0441 Overgrowth \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0451\u043b 17 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f 2008 \u0433\u043e\u0434\u0430, \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0438\u0433\u0440\u044b \u0432\u044b\u0448\u043b\u0430 16 \u043e\u043a\u0442\u044f\u0431\u0440\u044f 2017 \u0433\u043e\u0434\u0430.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u044f\u0442, \u044f \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0435\u0439: <a href=\"https:\/\/github.com\/WolfireGames\/overgrowth\/tree\/f2a67f79e3205a45bd90ed5021276b9e6aa86132\">f2a67f7<\/a>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0441\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 PVS-Studio.<\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N1, N2<\/h4>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 PVS-Studio \u0432\u044b\u0434\u0430\u043b \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v611\/\">V611<\/a> [CERT-MEM51-CPP] The memory was allocated using &#8216;new T[]&#8217; operator but was released using the &#8216;delete&#8217; operator. Consider inspecting this code. It&#8217;s probably better to use &#8216;delete [] heightfieldData;&#8217;. PhysicsServerCommandProcessor.cpp 4741<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v773\/\">V773<\/a> [CERT-MEM31-C, CERT-MEM51-CPP] The function was exited without releasing the &#8216;worldImporter&#8217; pointer. A memory leak is possible. PhysicsServerCommandProcessor.cpp 4742<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   btMultiBodyWorldImporter* worldImporter = new btMultiBodyWorldImporter(....);   ....   const unsigned char* heightfieldData = 0;   ....   heightfieldData = new unsigned char[width * height * sizeof(btScalar)];   ....   delete heightfieldData;   return ....; } <\/code><\/pre>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0438\u0441\u0430\u043b \u0434\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0432 \u0421++.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v773\/\">V773<\/a>, \u043a\u0430\u043a \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e. \u041f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>worldImporter<\/em> \u0431\u044b\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>new<\/em> \u0438 \u043f\u043e \u0432\u044b\u0445\u043e\u0434\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u0431\u044b\u043b\u0430 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0430. \u042d\u0442\u043e \u043f\u043b\u043e\u0445\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0442\u0435\u0447\u043a\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b, \u043f\u043e\u0437\u0432\u0430\u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>delete<\/em> \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u0438\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044e <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v611\/\">V611<\/a> \u0438 \u0431\u0443\u0444\u0435\u0440\u0443 <em>heightfieldData<\/em>. \u0422\u0443\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u043e\u0434\u043d\u0430\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431 \u043f\u043e\u0437\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>delete[]<\/em> \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u043d\u0435\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>new[]<\/em>, \u043e\u043d \u043f\u043e\u0437\u0432\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <em>delete<\/em>. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0432\u043e\u0442 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4861\/expr.delete#2\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0443\u043d\u043a\u0442.<\/p>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   btMultiBodyWorldImporter* worldImporter = new btMultiBodyWorldImporter(....);   ....   const unsigned char* heightfieldData = 0;   ....   heightfieldData = new unsigned char[width * height * sizeof(btScalar)];   ....    delete   worldImporter;   delete[] heightfieldData;   return ....; } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0440\u0443\u0447\u043d\u043e\u0439 \u043e\u0447\u0438\u0441\u0442\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043a\u043e\u0434 \u043f\u043e\u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 <em>std::unique_ptr<\/em> \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0440\u043e\u0447\u0435 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u0435\u0435. \u041e\u043d \u0437\u0430\u0449\u0438\u0442\u0438\u0442 \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0451\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u0434\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u043c \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   auto worldImporter = std::make_unique&lt;btMultiBodyWorldImporter> ();   ....   std::unique_ptr&lt;unsigned char[]> heightfieldData;   ....   heightfieldData = std::make_unique_for_overwrite&lt;unsigned char[]>                                 (width * height * sizeof(btScalar));   ....   return ....; } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N3<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v772\/\">V772<\/a> [CERT-MSC15-C] Calling a &#8216;delete&#8217; operator for a void pointer will cause undefined behavior. OVR_CAPI_Util.cpp 380<\/p>\n<pre><code class=\"cpp\">typedef struct ovrHapticsClip_ {   const void* Samples;   .... } ovrHapticsClip; ....  OVR_PUBLIC_FUNCTION(void) ovr_ReleaseHapticsClip(ovrHapticsClip* hapticsClip) {   if (hapticsClip != NULL &amp;&amp; hapticsClip->Samples != NULL)    {     delete[] hapticsClip->Samples;   ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <em>delete<\/em> \u0438 <em>delete[]<\/em> \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 void \u0432\u0435\u0434\u0451\u0442 \u043a <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4861\/expr.delete#footnote-73\">\u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e<\/a>. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043a \u0435\u0433\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u043f\u0440\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0433\u043b\u0443\u0431\u043e\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u044f \u043f\u0440\u043e\u0432\u0451\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u041f\u043e\u043b\u0435 <em>Samples<\/em> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u0442\u0438\u043f\u043e\u043c <em>uint8_t*<\/em>. \u0412\u043e\u0442 \u043f\u0440\u0443\u0444:<\/p>\n<pre><code class=\"cpp\">.... ovr_GenHapticsFromAudioData(ovrHapticsClip* outHapticsClip, ....) {   ....   uint8_t* hapticsSamples = new uint8_t[hapticsSampleCount];   ....    outHapticsClip->Samples = hapticsSamples;    .... } <\/code><\/pre>\n<p>\u042d\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e\u0431 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u043d\u044c\u0448\u0435 \u043e\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0438 \u044d\u0442\u043e \u0443\u0431\u0440\u0430\u043b\u0438 \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u043f\u043e\u043b\u044f <em>Samples<\/em> \u0441 <em>void*<\/em> \u043d\u0430 <em>uint8_t*<\/em> \u0437\u0430\u0431\u044b\u043b\u0438.<\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430 \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e, \u043e\u043d \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0438 \u0432\u0435\u0434\u0451\u0442 \u043a UB.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N4<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v595\/\">V595<\/a> [CERT-EXP12-C] The &#8216;ctx&#8217; pointer was utilized before it was verified against nullptr. Check lines: 130, 131. ascontext.cpp 130<\/p>\n<pre><code class=\"cpp\">class ASContext { public:   asIScriptContext *ctx; }  ASContext::ASContext(....) {   ctx = ....;   ctx->SetUserData(this, 0);   if( ctx == 0 )    {     FatalError(\"Error\",\"Failed to create the context.\");     return;   }   .... } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>ctx<\/em> \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>0<\/em>. \u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u043f\u0430\u0441\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <em>ctx<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u0435\u043d <em>nullptr<\/em>, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">ASContext::ASContext(....) {   ctx = ....;   if( !ctx )   {     FatalError(\"Error\",\"Failed to create the context.\");     return;   }    ctx->SetUserData(this, 0);   .... } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N5<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;connect_id_ == &#8212; 1&#8217; is always true. placeholderobject.cpp 342<\/p>\n<pre><code class=\"cpp\">class PlaceholderObject { private:   int connect_id_;   .... };  ObjectSanityState PlaceholderObject::GetSanity() {   ....   if( .... &amp;&amp; connect_id_ == -1)    {     if( connect_id_ == -1)      {       ....     }    }    .... } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 <em>connect_id_ == -1<\/em>. \u041e\u043d\u0430 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>connect_id_<\/em> \u0441 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0430\u0441\u044c.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0430\u044f-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430 \u0438 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">ObjectSanityState PlaceholderObject::GetSanity() {   ....   if( .... &amp;&amp; connect_id_ == -1 )    {       ....   }    .... } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N6<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v791\/\">V791<\/a> The initial value of the index in the nested loop equals &#8216;i&#8217;. Perhaps, &#8216;i + 1&#8217; should be used instead. navmeshhintobject.cpp 65<\/p>\n<pre><code class=\"cpp\">NavmeshHintObject::NavmeshHintObject() {   ....   for( int i = 0; i &lt; 8; i++ )   {     for( int k = i; k &lt; 8; k++ )     {       if( i != k )       {         if(              corners[i][0] == corners[k][0] ||             corners[i][1] == corners[k][1] ||             corners[i][2] == corners[k][2]            )           {             cross_marking.push_back(corners[i]);                cross_marking.push_back(corners[k]);              }       }     }   }   .... } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u044f\u0432\u0438\u043b \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0446\u0438\u043a\u043b. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043a\u043e\u0434\u0430 \u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u0430\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0430\u0440\u044b, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <em>i == j<\/em>. \u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">NavmeshHintObject::NavmeshHintObject() {   ....   for( int i = 0; i &lt; 8; i++ )   {     for( int k = i + 1; k &lt; 8; k++ )     {       if(            corners[i][0] == corners[k][0] ||           corners[i][1] == corners[k][1] ||           corners[i][2] == corners[k][2]          )         {           cross_marking.push_back(corners[i]);              cross_marking.push_back(corners[k]);            }     }   }   .... } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N7<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v561\/\">V561<\/a> [CERT-DCL01-C] It&#8217;s probably better to assign value to &#8216;other_radius_sq&#8217; variable than to declare it anew. Previous declaration: scenegraph.cpp, line 2006. scenegraph.cpp 2010<\/p>\n<pre><code class=\"cpp\">bool SceneGraph::AddDynamicDecal(....) {   ....   float other_radius_sq = ....;   if(....)   {     ....     float other_radius_sq = ....;   }   .... } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>other_radius_sq<\/em>. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u2014 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N8, N9<\/h4>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;imageBits == 8&#8217; is always false. texture_data.cpp 305<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;imageBits == 24&#8217; is always false. texture_data.cpp 313<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">void TextureData::GetUncompressedData(unsigned char* data)  {   int imageBits = 32;   ....   if (imageBits == 8)   {     ....   }   else if (imageBits == 24)   {     ....   }   .... } <\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>imageBits<\/em> \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u044f\u0432\u0438\u043b \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0438\u043b\u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N10, N11<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v769\/\">V769<\/a> [CERT-EXP08-C] The &#8216;idx_buffer_offset&#8217; pointer in the &#8216;idx_buffer_offset += pcmd->ElemCount&#8217; expression equals nullptr. The resulting value is senseless and it should not be used. imgui_impl_sdl_gl3.cpp 138<\/p>\n<pre><code class=\"cpp\">void ImGui_ImplSdlGL3_RenderDrawLists(ImDrawData* draw_data) {   const ImDrawIdx* idx_buffer_offset = 0;   ....   idx_buffer_offset += pcmd->ElemCount;   .... } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u0443\u044e \u043a \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-334887","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/334887","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=334887"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/334887\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=334887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=334887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=334887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}