{"id":316654,"date":"2021-01-20T15:00:40","date_gmt":"2021-01-20T15:00:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=316654"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=316654","title":{"rendered":"Espressif IoT Development Framework: 71 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0432 \u043d\u043e\u0433\u0443"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fe3\/e2d\/b35\/fe3e2db3546a1ccb216647dfbe6849b5.png\" alt=\"0790_Espressif_IoT_Development_Framework_ru\/image1.png\"><br \/>  \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u043d\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 Espressif IoT Development Framework. \u041e\u043d \u043d\u0430\u0448\u0451\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0441\u044f, \u0441\u043c\u043e\u0433 \u0431\u044b \u0435\u0451 \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u043a\u0430 \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442, \u0437\u0430\u0442\u043e \u043d\u0430\u0448\u0451\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445. \u041f\u043e \u043c\u043e\u0442\u0438\u0432\u0430\u043c \u044d\u0442\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e IoT \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 &quot;\u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0432\u0430\u043c \u0432 \u043d\u043e\u0433\u0443&quot;.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"programmno-apparatnye-sistemy\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e-\u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h2>\n<p>  <\/p>\n<p>\u041e\u0442\u0435\u0446 \u044f\u0437\u044b\u043a\u0430 C++ \u0411\u044c\u044f\u0440\u043d\u0435 \u0421\u0442\u0440\u0430\u0443\u0441\u0442\u0440\u0443\u043f \u043a\u0430\u043a-\u0442\u043e <a href=\"https:\/\/www.quotes.net\/quote\/9012\">\u0441\u043a\u0430\u0437\u0430\u043b<\/a>:<\/p>\n<p>  <\/p>\n<blockquote><p>&quot;\u0421\u0438&quot; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u043d\u043e\u0433\u0443. \u041d\u0430 &quot;\u0421\u0438++&quot; \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0435, \u043e\u0442\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u044e \u043d\u043e\u0433\u0443.<\/p><\/blockquote>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u043e\u0439 \u0441\u043c\u044b\u0441\u043b. \u0418\u0437 \u0438\u0434\u0435\u0438, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043c\u044b \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u043c, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0447\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0440\u0435\u0434.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043a\u0430\u043a Espressif IoT Development Framework, \u0441\u043b\u0443\u0436\u0430\u0442 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e-\u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435. \u0412\u0441\u0451 \u044d\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u0442\u0441\u044e\u0434\u0430 \u0431\u0435\u0440\u0443\u0442 \u043e\u0441\u043d\u043e\u0432\u044b \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b \u043a\u0430\u043a <a href=\"https:\/\/www.viva64.com\/ru\/misra\/\">MISRA<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/www.viva64.com\/ru\/autosar\/\">AUTOSAR<\/a>. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0430\u044f \u0442\u0435\u043c\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a <a href=\"https:\/\/www.espressif.com\/en\/products\/sdks\/esp-idf\">Espressif IoT Development Framework<\/a> (\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 GitHub: <a href=\"https:\/\/github.com\/espressif\/esp-idf\">esp-idf<\/a>). \u0412\u043e\u0442 \u0435\u0433\u043e \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<blockquote><p>ESP-IDF is Espressif&#8217;s official IoT Development Framework for the ESP32 and ESP32-S series of SoCs. It provides a self-sufficient SDK for any generic application development on these platforms, using programming languages such as C and C++. ESP-IDF currently powers millions of devices in the field, and enables building a variety of network-connected products, ranging from simple light bulbs and toys to big appliances and industrial devices.<\/p><\/blockquote>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0443\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043a\u043e\u0439 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043d\u0435\u0442. \u041f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0444\u0435\u043a\u0442\u043e\u0432, \u0432\u044b \u043f\u043e\u0439\u043c\u0435\u0442\u0435 \u043c\u043e\u0438 \u043e\u043f\u0430\u0441\u0435\u043d\u0438\u044f. \u0418\u0442\u0430\u043a, \u0437\u0430\u0432\u0430\u0440\u0438\u0432\u0430\u0439\u0442\u0435 \u0447\u0430\u0439\/\u043a\u043e\u0444\u0435, \u0432\u0430\u0441 \u0436\u0434\u0451\u0442 \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"predystoriya\">\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f. \u041c\u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b <a href=\"https:\/\/habr.com\/ru\/users\/DjPhoeniX\/\">\u042e\u0440\u0438\u0439 \u041f\u043e\u043f\u043e\u0432<\/a> (Hardcore IoT fullstack dev &amp; CTO), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u043c \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u043d\u0430\u0448\u0438\u043c\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438. \u041d\u0435\u0437\u0430\u0434\u043e\u043b\u0433\u043e \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043d\u0430\u0448\u0451\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 Espressif IoT Development Framework \u0438 \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0441\u044f, \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0434\u0435\u0444\u0435\u043a\u0442 PVS-Studio. \u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u043e\u0439 \u043a\u043e\u0434\u0435, \u0430 PVS-Studio \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043b\u0430\u0432\u0438\u043b\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u044b\u044f\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/github.com\/espressif\/esp-idf\/blob\/v4.0.2\/components\/mdns\/mdns.c\">mdns.c<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">mdns_txt_linked_item_t * txt = service-&gt;txt; while (txt) {   data_len += 2 + strlen(service-&gt;txt-&gt;key) + strlen(service-&gt;txt-&gt;value);   txt = txt-&gt;next; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0445\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a, \u0445\u0440\u0430\u043d\u044f\u0449\u0430\u044f\u0441\u044f \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">data_len += 2 + strlen(txt-&gt;key) + strlen(txt-&gt;value);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a \u043e\u0431\u043e\u044e\u0434\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u0435\u043d\u044f \u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u042e\u0440\u044b, PVS-Studio \u043d\u0435 \u0441\u043c\u043e\u0433 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043e\u0448\u0438\u0431\u043a\u0438. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u043d\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0435 \u0437\u043d\u0430\u043b\u0430 \u043f\u0440\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d. PVS-Studio, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u0443\u043c\u0435\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u043d\u0430 \u0447\u0442\u043e \u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0438 :).<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436, \u0436\u0430\u043b\u044c, \u043d\u043e \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e. \u042d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u043f\u0430\u0442\u044c \u0438\u0434\u0435\u0438 \u043f\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044e PVS-Studio. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u0438 \u0432\u044b\u044f\u0432\u0438\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u043e \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 PVS-Studio. \u0418 \u043c\u044b \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u0422\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0438 \u0441 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c. \u041c\u044b \u0443\u0436\u0435 \u0432\u044b\u043f\u0438\u0441\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 TODO \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0436\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0430\u043c \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e, \u042e\u0440\u0430 \u0441\u0430\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0443 \u043f\u0440\u043e \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443, \u043a\u0430\u043a \u043e\u043d \u0435\u0451 \u0438\u0441\u043a\u0430\u043b \u0438 \u043f\u0440\u043e PVS-Studio: &quot;<a href=\"https:\/\/habr.com\/ru\/post\/530466\/\">\u0411\u0430\u0433 \u0432 ESP-IDF: MDNS, Wireshark \u0438 \u043f\u0440\u0438 \u0447\u0451\u043c \u0442\u0443\u0442 \u0435\u0434\u0438\u043d\u043e\u0440\u043e\u0433\u0438<\/a>&quot;. \u041f\u043b\u044e\u0441 \u043e\u043d \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u043b \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435: <a href=\"https:\/\/github.com\/espressif\/esp-idf\/issues\/6114\">Spurious MDNS collision detection (IDFGH-4263)<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c. \u042e\u0440\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0442\u043a\u0443 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445. \u041c\u044b \u043d\u0435 \u0441\u0442\u0430\u043b\u0438 \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0435\u0441\u044c\u043c\u0430 \u0447\u0430\u0441\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c <a href=\"https:\/\/www.viva64.com\/ru\/inspections\/\">\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438<\/a> \u0434\u043b\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430 \u0438 \u0437\u0430\u043e\u0434\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 PVS-Studio :).<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0430\u0432\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u044b \u043f\u043e\u0432\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0443\u043a\u043b\u044e\u0436\u0435. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 &quot;\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0451&quot;. \u041d\u0443 \u0438\u043b\u0438 \u043c\u044b \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c. \u041c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0441 getting_started\\hello_world. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u0422\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0434\u043e\u0431\u0438\u0432\u0448\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0442\u043e, \u0447\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e 71 \u043e\u0448\u0438\u0431\u043a\u0430, \u2014 \u044d\u0442\u043e \u043d\u0430\u0448\u0430 \u043d\u0435\u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 :).<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u044f \u0431\u0435\u0433\u043b\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u043b\u0441\u044f \u043f\u043e \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u043e\u0442\u0447\u0451\u0442\u0443, \u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0438 \u0442\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u043b\u0435\u043d\u0438\u043b\u0441\u044f \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0443 \u042e\u0440\u0438\u044f \u041f\u043e\u043f\u043e\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0430\u0440\u0438\u043b \u0432\u0441\u044e \u044d\u0442\u0443 \u043a\u0430\u0448\u0443, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u044d\u043d\u0442\u0443\u0437\u0438\u0430\u0437\u043c\u0430, \u0447\u0435\u043c \u0443 \u043c\u0435\u043d\u044f. \u041e\u043d \u0441\u043e\u043e\u0431\u0449\u0438\u043b, \u0447\u0442\u043e \u0441\u043c\u043e\u0433 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u0430\u0439\u043b\u043e\u0432. \u0418, \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432\u0441\u043b\u0435\u0434 \u0437\u0430 \u043c\u043e\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439, \u0432\u044b\u0439\u0434\u0435\u0442 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u044c\u044f, \u0433\u0434\u0435 \u043e\u043d \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0440\u0446\u0438\u044e \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  <\/p>\n<h2 id=\"primery-otkuda-berutsya-lozhnyebessmyslennye-srabatyvaniya\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b, \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u043b\u043e\u0436\u043d\u044b\u0435\/\u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0412\u0441\u0435\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0445\u043e\u0442\u044f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c Espressif IoT Development Framework, \u044f \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430. \u0411\u0435\u0437 \u043d\u0435\u0451 \u0432\u044b \u0443\u0442\u043e\u043d\u0438\u0442\u0435 \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u043e\u0436\u043d\u044b\u0445\/\u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439. \u041d\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u0432\u0438\u043d\u043e\u0432\u0430\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0447\u0435\u043d\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 (#ifdef) \u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b. \u0422\u0430\u043a\u043e\u0439 \u0441\u0442\u0438\u043b\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0442\u044b\u0432\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0438 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u043a\u0430\u043a \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0430\u0440\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;ret != 0&#8217; is always true. esp_hidd.c 45<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">esp_err_t esp_hidd_dev_init(....) {   esp_err_t ret = ESP_OK;   ....   switch (transport) { #if CONFIG_GATTS_ENABLE   case ESP_HID_TRANSPORT_BLE:     ret = esp_ble_hidd_dev_init(dev, config, callback);     break; #endif \/* CONFIG_GATTS_ENABLE *\/   default:     ret = ESP_FAIL;     break;   }    if (ret != ESP_OK) {     free(dev);     return ret;   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0431\u0440\u0430\u043d \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0436\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u0430\u043a\u0440\u043e\u0441 <em>CONFIG_GATTS_ENABLE<\/em> \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">esp_err_t ret = ESP_OK; .... switch (transport) { default:   ret = ESP_FAIL;   break; } if (ret != ESP_OK) {<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u0440\u043e\u0434\u0435 \u043f\u0440\u0430\u0432, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043f\u043e\u043b\u044c\u0437\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u043a\u043e\u0434 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d \u0438 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u0447\u0430\u0441\u0442\u043e, \u0447\u0442\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043e\u0442\u0447\u0451\u0442\u0430. \u042d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 :).<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u0412 \u043a\u043e\u0434\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u044f \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c assert-\u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0441\u0431\u0438\u0432\u0430\u044e\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441 \u0442\u043e\u043b\u043a\u0443. \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;sntp_pcb != NULL&#8217; is always true. sntp.c 664<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#define LWIP_PLATFORM_ASSERT(x) do \\   {printf(&quot;Assertion \\&quot;%s\\&quot; failed at line %d in %s\\n&quot;, \\     x, __LINE__, __FILE__); fflush(NULL); abort();} while(0)  #ifndef LWIP_NOASSERT #define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \\   LWIP_PLATFORM_ASSERT(message); }} while(0) #else  \/* LWIP_NOASSERT *\/ #define LWIP_ASSERT(message, assertion) #endif \/* LWIP_NOASSERT *\/  sntp_pcb = udp_new_ip_type(IPADDR_TYPE_ANY); LWIP_ASSERT(&quot;Failed to allocate udp pcb for sntp client&quot;, sntp_pcb != NULL); if (sntp_pcb != NULL) {<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u043a\u043e\u0434 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>LWIP_ASSERT<\/em> \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0441\u043c. \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>abort<\/em>), \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>sntp_pcb<\/em> \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u043b\u0435\u0432\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 PVS-Studio \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 (<em>sntp_pcb != NULL<\/em>) \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<p>  <\/p>\n<p>\u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0430\u0432. \u041d\u043e \u0432\u0441\u0451 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043c\u0430\u043a\u0440\u043e\u0441 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043a\u0440\u044b\u0442 \u0432 &quot;\u043d\u0438\u0447\u0442\u043e&quot;. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043c\u044b\u0441\u043b. \u0414\u0430, \u043f\u0440\u0438 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0440\u0443\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u043b\u0438\u0448\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0432\u0441\u0451 \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e. \u0415\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c\u0441\u044f \u0437\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u0441\u0435\u0440\u044c\u0435\u0437, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0442\u0430\u043a, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0441\u0447\u0435\u0437\u043d\u0435\u0442. \u0415\u0449\u0451 \u0432 \u0440\u044f\u0434\u0435 \u043c\u0435\u0441\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432. \u041d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u0432 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u0445 \u0438 \u0442.\u0434. \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438. \u041f\u0440\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &quot;<a href=\"https:\/\/www.viva64.com\/ru\/b\/0743\/\">\u041a\u0430\u043a \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u0432 legacy \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043d\u0435 \u0434\u0435\u043c\u043e\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/a>&quot;.<\/p>\n<p>  <\/p>\n<h2 id=\"security\">Security<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0442\u0435\u043c\u043e\u0439 security. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0434\u043e\u043b\u0436\u043d\u044b \u0441 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0441\u043b\u0430\u0431\u043e\u0441\u0442\u0435\u0439 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044e \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043b\u0430\u0431\u043e\u0441\u0442\u0435\u0439 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/cwe.mitre.org\/\">CWE<\/a> (Common Weakness Enumeration). \u0412 PVS-Studio \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 CWE ID \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u044b \u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 CWE ID.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0442\u0435\u043c\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &quot;<a href=\"https:\/\/www.viva64.com\/ru\/b\/0689\/\">\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 PVS-Studio \u043a\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0434\u043d\u044f<\/a>&quot;.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n1-poryadok-argumentov\">\u041e\u0448\u0438\u0431\u043a\u0430 N1; \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V764 Possible incorrect order of arguments passed to &#8216;crypto_generichash_blake2b__init_salt_personal&#8217; function: &#8216;salt&#8217; and &#8216;personal&#8217;. blake2b-ref.c 457<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">int blake2b_init_salt_personal(blake2b_state *S, const uint8_t outlen,                                const void *personal, const void *salt);  int blake2b_salt_personal(uint8_t *out, const void *in, const void *key,                       const uint8_t outlen, const uint64_t inlen,                       uint8_t keylen, const void *salt, const void *personal) {   ....   if (blake2b_init_salt_personal(S, outlen, salt, personal) &lt; 0)     abort();   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>blake2b_init_salt_personal<\/em> \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043d\u044b \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b <em>personal<\/em> \u0438 <em>salt<\/em>. \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0432\u0440\u044f\u0434 \u043b\u0438 \u044d\u0442\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0438, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430, \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0430\u044f \u043f\u043e \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u042f \u043d\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0441\u044c \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0432 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438, \u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043c\u043d\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e CWE \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a <a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/683.html\">CWE-683<\/a>: Function Call With Incorrect Order of Arguments.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n2-otbrasyvanie-znachaschih-bit\">\u041e\u0448\u0438\u0431\u043a\u0430 N2; \u041e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0430\u0449\u0438\u0445 \u0431\u0438\u0442<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V642 Saving the &#8216;memcmp&#8217; function result inside the &#8216;unsigned char&#8217; type variable is inappropriate. The significant bits could be lost breaking the program&#8217;s logic. mbc_tcp_master.c 387<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static esp_err_t mbc_tcp_master_set_request(   char* name, mb_param_mode_t mode, mb_param_request_t* request,   mb_parameter_descriptor_t* reg_data) {   ....   \/\/ Compare the name of parameter with parameter key from table   uint8_t comp_result = memcmp((const char*)name,                                (const char*)reg_ptr-&gt;param_key,                                (size_t)param_key_len);   if (comp_result == 0) {   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>memcmp<\/em> \u0432 \u043e\u0434\u043d\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u2014 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e. \u042d\u0442\u043e \u0434\u0435\u0444\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c, \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u044d\u0442\u043e\u0439: <a href=\"https:\/\/seclists.org\/oss-sec\/2012\/q2\/493\">CVE-2012-2122<\/a>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0435 <a href=\"https:\/\/www.viva64.com\/ru\/w\/v642\/\">V642<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>memset<\/em> \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 1 \u0438\u043b\u0438 -1. \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1024. \u0410 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0438\u043f\u0430 <em>uint8_t<\/em> \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 0.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e CWE \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a <a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/197.html\">CWE-197<\/a>: Numeric Truncation Error.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n3---n20-privatnye-dannye-ostayutsya-v-pamyati\">\u041e\u0448\u0438\u0431\u043a\u0430 N3 \u2014 N20; \u041f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;prk&#8217; buffer. The memset_s() function should be used to erase the private data. dpp.c 854<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#ifndef os_memset #define os_memset(s, c, n) memset(s, c, n) #endif  static int dpp_derive_k1(const u8 *Mx, size_t Mx_len, u8 *k1,        unsigned int hash_len) {   u8 salt[DPP_MAX_HASH_LEN], prk[DPP_MAX_HASH_LEN];   const char *info = &quot;first intermediate key&quot;;   int res;    \/* k1 = HKDF(&lt;&gt;, &quot;first intermediate key&quot;, M.x) *\/    \/* HKDF-Extract(&lt;&gt;, M.x) *\/   os_memset(salt, 0, hash_len);   if (dpp_hmac(hash_len, salt, hash_len, Mx, Mx_len, prk) &lt; 0)     return -1;   wpa_hexdump_key(MSG_DEBUG, &quot;DPP: PRK = HKDF-Extract(&lt;&gt;, IKM=M.x)&quot;,       prk, hash_len);    \/* HKDF-Expand(PRK, info, L) *\/   res = dpp_hkdf_expand(hash_len, prk, hash_len, info, k1, hash_len);    os_memset(prk, 0, hash_len);             \/\/ &lt;=   if (res &lt; 0)     return -1;    wpa_hexdump_key(MSG_DEBUG, &quot;DPP: k1 = HKDF-Expand(PRK, info, L)&quot;,                   k1, hash_len);   return 0; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u043f\u0440\u0430\u0432\u0435 \u0432 \u0446\u0435\u043b\u044f\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>memset<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 \u043d\u0443\u043b\u044f\u043c\u0438, \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u0437\u0430\u0442\u0438\u0440\u0430\u044e\u0442\u0441\u044f, \u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442 \u0431\u043e\u043b\u0442\u0430\u0442\u044c\u0441\u044f \u0433\u0434\u0435-\u0442\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &quot;<a href=\"https:\/\/www.viva64.com\/ru\/b\/0388\/\">\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/a>&quot;.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e CWE \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a <a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/14.html\">CWE-14<\/a>: Compiler Removal of Code to Clear Buffers.<\/p>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;prk&#8217; buffer. The memset_s() function should be used to erase the private data. dpp.c 883<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;prk&#8217; buffer. The memset_s() function should be used to erase the private data. dpp.c 942<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;psk&#8217; buffer. The memset_s() function should be used to erase the private data. dpp.c 3939<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;prk&#8217; buffer. The memset_s() function should be used to erase the private data. dpp.c 5729<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;Nx&#8217; buffer. The memset_s() function should be used to erase the private data. dpp.c 5934<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;val&#8217; buffer. The memset_s() function should be used to erase the private data. sae.c 155<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;keyseed&#8217; buffer. The memset_s() function should be used to erase the private data. sae.c 834<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;keys&#8217; buffer. The memset_s() function should be used to erase the private data. sae.c 838<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;pkey&#8217; buffer. The memset_s() function should be used to erase the private data. des-internal.c 422<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;ek&#8217; buffer. The memset_s() function should be used to erase the private data. des-internal.c 423<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;finalcount&#8217; buffer. The memset_s() function should be used to erase the private data. sha1-internal.c 358<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;A_MD5&#8217; buffer. The memset_s() function should be used to erase the private data. sha1-tlsprf.c 95<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;P_MD5&#8217; buffer. The memset_s() function should be used to erase the private data. sha1-tlsprf.c 96<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;A_SHA1&#8217; buffer. The memset_s() function should be used to erase the private data. sha1-tlsprf.c 97<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;P_SHA1&#8217; buffer. The memset_s() function should be used to erase the private data. sha1-tlsprf.c 98<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;T&#8217; buffer. The memset_s() function should be used to erase the private data. sha256-kdf.c 85<\/li>\n<li>V597 The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;hash&#8217; buffer. The memset_s() function should be used to erase the private data. sha256-prf.c 105<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"oshibka-n21-ne-udalyaetsya-bufer-s-privatnymi-dannymi\">\u041e\u0448\u0438\u0431\u043a\u0430 N21; \u041d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0443\u0444\u0435\u0440 \u0441 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V575 The null pointer is passed into &#8216;free&#8217; function. Inspect the first argument. sae.c 1185<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int sae_parse_password_identifier(struct sae_data *sae,            const u8 *pos, const u8 *end) {   wpa_hexdump(MSG_DEBUG, &quot;SAE: Possible elements at the end of the frame&quot;,         pos, end - pos);   if (!sae_is_password_id_elem(pos, end)) {     if (sae-&gt;tmp-&gt;pw_id) {       wpa_printf(MSG_DEBUG,            &quot;SAE: No Password Identifier included, but expected one (%s)&quot;,            sae-&gt;tmp-&gt;pw_id);       return WLAN_STATUS_UNKNOWN_PASSWORD_IDENTIFIER;     }     os_free(sae-&gt;tmp-&gt;pw_id);     sae-&gt;tmp-&gt;pw_id = NULL;     return WLAN_STATUS_SUCCESS; \/* No Password Identifier *\/   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>pw_id<\/em> \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439, \u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0432\u043d\u043e\u0432\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>NULL<\/em>. \u0412\u0441\u0451 \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0435 \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043c\u0435\u0441\u0442\u0435. \u0418 \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (!sae_is_password_id_elem(pos, end)) {   if (sae-&gt;tmp-&gt;pw_id) {     wpa_printf(MSG_DEBUG,          &quot;SAE: No Password Identifier included, but expected one (%s)&quot;,          sae-&gt;tmp-&gt;pw_id);     os_free(sae-&gt;tmp-&gt;pw_id);     sae-&gt;tmp-&gt;pw_id = NULL;     return WLAN_STATUS_UNKNOWN_PASSWORD_IDENTIFIER;   }   return WLAN_STATUS_SUCCESS; \/* No Password Identifier *\/ }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442 \u0443\u0442\u0435\u0447\u043a\u0443 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0443\u0442 \u0433\u0434\u0435-\u0442\u043e \u0437\u0440\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e CWE, \u044d\u0442\u0430 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a <a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/628.html\">CWE-628: Function Call with Incorrectly Specified Arguments<\/a>. \u0422\u0430\u043a \u0435\u0451 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 PVS-Studio, \u043d\u043e, \u043f\u043e \u0441\u0443\u0442\u0438 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c, \u044d\u0442\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0434\u0440\u0443\u0433\u0430\u044f \u0441\u043b\u0430\u0431\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n22-n23-ispolzovanie-neinicializirovannogo-bufera-v-kachestve-klyucha\">\u041e\u0448\u0438\u0431\u043a\u0430 N22, N23; \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V614 Uninitialized buffer &#8216;hex&#8217; used. Consider checking the second actual argument of the &#8216;memcpy&#8217; function. wps_registrar.c 1657<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">int wps_build_cred(struct wps_data *wps, struct wpabuf *msg) {   ....   } else if (wps-&gt;use_psk_key &amp;&amp; wps-&gt;wps-&gt;psk_set) {     char hex[65];     wpa_printf(MSG_DEBUG,  &quot;WPS: Use PSK format for Network Key&quot;);     os_memcpy(wps-&gt;cred.key, hex, 32 * 2);     wps-&gt;cred.key_len = 32 * 2;   } else if (wps-&gt;wps-&gt;network_key) {   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 <em>hex<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043a\u043b\u044e\u0447\u0430. \u0417\u0430\u0447\u0435\u043c \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u2014 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043b\u044e\u0447 \u043a\u0430\u043a\u0438\u043c\u0438-\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e CWE, \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a <a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/457.html\">CWE-457<\/a>: Use of Uninitialized Variable.<\/p>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: V614 Uninitialized buffer &#8216;hex&#8217; used. Consider checking the second actual argument of the &#8216;memcpy&#8217; function. wps_registrar.c 1678<\/p>\n<p>  <\/p>\n<h2 id=\"opechatki-i-copy-paste\">\u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0438 Copy-Paste<\/h2>\n<p>  <\/p>\n<h3 id=\"oshibka-n24-copy-paste-klassicheskiy\">\u041e\u0448\u0438\u0431\u043a\u0430 N24; Copy-Paste \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V523 The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. timer.c 292<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">esp_err_t timer_isr_register(....) {   ....   if ((intr_alloc_flags &amp; ESP_INTR_FLAG_EDGE) == 0) {     intr_source = ETS_TG1_T0_LEVEL_INTR_SOURCE + timer_num;   } else {     intr_source = ETS_TG1_T0_LEVEL_INTR_SOURCE + timer_num;   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0432 \u043d\u0435\u0439 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>intr_source<\/em> \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u0411\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a \u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u043e\u043a\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c (\u0442.\u0435. \u044d\u0442\u043e &quot;todo-\u043a\u043e\u0434&quot;). \u041d\u043e \u0442\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u044f\u0432\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0441\u043d\u0430\u0431\u0434\u0438\u0442\u044c \u043f\u043e\u044f\u0441\u043d\u044f\u044e\u0449\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n25-ne-tam-postavlena-skobka\">\u041e\u0448\u0438\u0431\u043a\u0430 N25; \u041d\u0435 \u0442\u0430\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u043a\u043e\u0431\u043a\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V593 Consider reviewing the expression of the &#8216;A = B != C&#8217; kind. The expression is calculated as following: &#8216;A = (B != C)&#8217;. esp_tls_mbedtls.c 446<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">esp_err_t set_client_config(....) {  ....  if ((ret = mbedtls_ssl_conf_alpn_protocols(&amp;tls-&gt;conf, cfg-&gt;alpn_protos) != 0))  {    ESP_LOGE(TAG, &quot;mbedtls_ssl_conf_alpn_protocols returned -0x%x&quot;, -ret);    ESP_INT_EVENT_TRACKER_CAPTURE(tls-&gt;error_handle, ERR_TYPE_MBEDTLS, -ret);    return ESP_ERR_MBEDTLS_SSL_CONF_ALPN_PROTOCOLS_FAILED;  }  .... }<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/t\/0064\/\">\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442<\/a> \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">TEMP = mbedtls_ssl_conf_alpn_protocols(....) != 0; if ((ret = TEMP))   PRINT(...., -ret);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u043e\u0439\u043c\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435, \u043d\u043e \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>ret<\/em>. \u041d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>ret<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e 0 \u0438\u043b\u0438 1. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a, \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (-1).<\/p>\n<p>  <\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u043a\u043e\u0431\u043e\u0447\u043a\u0430. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if ((ret = mbedtls_ssl_conf_alpn_protocols(&amp;tls-&gt;conf, cfg-&gt;alpn_protos)) != 0)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">ret = mbedtls_ssl_conf_alpn_protocols(....); if (ret != 0)   PRINT(...., -ret);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n26-mp_mem-prevraschaetsya-v-mp_yes\">\u041e\u0448\u0438\u0431\u043a\u0430 N26; MP_MEM \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 MP_YES<\/h3>\n<p>  <\/p>\n<p>V593 Consider reviewing the expression of the &#8216;A = B != C&#8217; kind. The expression is calculated as following: &#8216;A = (B != C)&#8217;. libtommath.h 1660<\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b. \u041e\u043d\u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430\u043c \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#define MP_OKAY       0   \/* ok result *\/ #define MP_MEM        -2  \/* out of mem *\/ #define MP_VAL        -3  \/* invalid input *\/ #define MP_YES        1   \/* yes response *\/<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>mp_init_multi<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>MP_OKAY<\/em> \u0438 <em>MP_MEM<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int mp_init_multi(mp_int *mp, ...);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u0434 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d) {   ....   \/* init our temps *\/   if ((res = mp_init_multi(&amp;ta, &amp;tb, &amp;tq, &amp;q, NULL) != MP_OKAY)) {      return res;   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0431\u043e\u043b\u0435\u0435 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if ((res = mp_init_multi(....) != MP_OKAY))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043d\u043e\u0432\u044c \u043d\u0435 \u0442\u0430\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u043a\u043e\u0431\u043a\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">TEMP = (mp_init_multi(....) != MP_OKAY);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>TEMP<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 0 \u0438\u043b\u0438 1. \u042d\u0442\u0438\u043c \u0447\u0438\u0441\u043b\u0430\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b <em>MB_OKAY<\/em> \u0438 <em>MP_YES<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if ((res = TEMP))    return res;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0438\u0434\u0438\u0442\u0435 \u043f\u043e\u0434\u0432\u043e\u0445? \u0421\u0442\u0430\u0442\u0443\u0441 \u043e\u0448\u0438\u0431\u043a\u0438 <em>MP_MEM<\/em> (-2) \u0432\u0434\u0440\u0443\u0433 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 \u0441\u0442\u0430\u0442\u0443\u0441 <em>MB_YES<\/em> (1). \u041f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n27-zabyli-razymenovat-ukazatel\">\u041e\u0448\u0438\u0431\u043a\u0430 N27; \u0417\u0430\u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#8216;outbuf&#8217; pointer was utilized before it was verified against nullptr. Check lines: 374, 381. protocomm.c 374<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int protocomm_version_handler(uint32_t session_id,                                      const uint8_t *inbuf, ssize_t inlen,                                      uint8_t **outbuf, ssize_t *outlen,                                      void *priv_data) {     protocomm_t *pc = (protocomm_t *) priv_data;     if (!pc-&gt;ver) {         *outlen = 0;         *outbuf = NULL;                                  \/\/ &lt;=         return ESP_OK;     }      \/* Output is a non null terminated string with length specified *\/     *outlen = strlen(pc-&gt;ver);     *outbuf = malloc(*outlen);                           \/\/ &lt;=     if (outbuf == NULL) {                                \/\/ &lt;=         ESP_LOGE(TAG, &quot;Failed to allocate memory for version response&quot;);         return ESP_ERR_NO_MEM;     }      memcpy(*outbuf, pc-&gt;ver, *outlen);     return ESP_OK; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>pc-&gt;ver<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u0441\u0440\u043e\u0447\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435 <em>outbuf<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">*outbuf = NULL;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0438\u0441\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438 \u0434\u0430\u043b\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">*outbuf = malloc(*outlen);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u0442\u043e, \u0447\u0442\u043e \u0437\u0430\u0442\u0435\u043c \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (outbuf == NULL)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c. \u041b\u044f\u043f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0442\u043e \u0434\u0435\u043b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0435 \u0441\u0430\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u043d\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u0430\u043b\u0438\u0441\u044c \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f (*).<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">*outbuf = malloc(*outlen); if (*outbuf == NULL) {   ESP_LOGE(TAG, &quot;Failed to allocate memory for version response&quot;);   return ESP_ERR_NO_MEM; }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"oshibka-n28-povtornoe-prisvaivanie\">\u041e\u0448\u0438\u0431\u043a\u0430 N28; \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V519 The &#8216;usRegCount&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 186, 187. mbfuncholding.c 187<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">eMBException eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) {   ....   USHORT          usRegCount;   ....   usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF] &lt;&lt; 8 );   usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF + 1] );   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u044f\u0432\u043d\u043e \u043f\u0438\u0441\u0430\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c Copy-Paste. \u0421\u0442\u0440\u043e\u0447\u043a\u0443 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e. \u041f\u043e \u0441\u043e\u0441\u0435\u0434\u0441\u0442\u0432\u0443 \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_REGCNT_OFF] &lt;&lt; 8 ); usRegCount |= ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_REGCNT_OFF + 1] );<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0438\u0434\u0438\u043c\u043e, \u0438 \u0432 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 =, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 |=.<\/p>\n<p>  <\/p>\n<h2 id=\"logicheskie-oshibki\">\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h2>\n<p>  <\/p>\n<h3 id=\"oshibka-n29---n31-nepravilnaya-rabota-s-kodami-vozvrata-rare\">\u041e\u0448\u0438\u0431\u043a\u0430 N29 \u2014 N31; \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u0434\u0430\u043c\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 (Rare)<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression is always false. linenoise.c 256<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int getColumns(void) {   ....   \/* Restore position. *\/   if (cols &gt; start) {     char seq[32];     snprintf(seq,32,&quot;\\x1b[%dD&quot;,cols-start);     if (fwrite(seq, 1, strlen(seq), stdout) == -1) {       \/* Can't recover... *\/     }     flushWrite();   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u0430 \u0432 \u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435, \u0447\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e. \u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443, \u0442\u0430\u043a \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c :). \u0425\u043e\u0442\u044f, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b, \u044d\u0442\u043e\u0442 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u044f\u0432\u043d\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u0434\u0440\u0430\u0436\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0442\u044c \u0436\u0435 \u0441\u0430\u043c\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>fwrite<\/em> \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 -1. \u042d\u0442\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>fwrite<\/em> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 <em>size_t<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">size_t fwrite( const void *restrict buffer, size_t size, size_t count,                FILE *restrict stream );<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u0430 <a href=\"https:\/\/en.cppreference.com\/w\/c\/io\/fwrite\">\u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/a>:<\/p>\n<p>  <\/p>\n<blockquote><p>The number of objects written successfully, which may be less than count if an error occurs.<\/p>\n<p>  If size or count is zero, fwrite returns zero and performs no other action.<\/p><\/blockquote>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u043e\u0439 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>V547 Expression is always false. linenoise.c 481<\/li>\n<li>V547 Expression is always false. linenoise.c 569<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"oshibka-n32-n33-nepravilnaya-rabota-s-kodami-vozvrata-medium\">\u041e\u0448\u0438\u0431\u043a\u0430 N32, N33; \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u0434\u0430\u043c\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 (Medium)<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression is always false. linenoise.c 596<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">int linenoiseEditInsert(struct linenoiseState *l, char c) {   ....   if (fwrite(&amp;c,1,1,stdout) == -1) return -1;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044f \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0442\u0430 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043e\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0430. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0444\u0430\u0439\u043b, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>linenoiseEditInsert<\/em> \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 -1. \u041d\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0442\u0430\u043a \u043a\u0430\u043a <em>fwrite<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u0435\u0440\u043d\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 -1. \u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b.<\/p>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c: V547 Expression is always false. linenoise.c 742.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n34-nepravilnaya-rabota-s-kodami-vozvrata-well-done\">\u041e\u0448\u0438\u0431\u043a\u0430 N34; \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u0434\u0430\u043c\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 (Well Done)<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression is always false. linenoise.c 828<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int linenoiseEdit(char *buf, size_t buflen, const char *prompt)   ....   while(1) {     ....     if (fread(seq+2, 1, 1, stdin) == -1) break;     ....   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <em>fwrite<\/em>, \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em><a href=\"https:\/\/en.cppreference.com\/w\/c\/io\/fread\">fread<\/a><\/em> \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 -1.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">size_t fread( void *restrict buffer, size_t size, size_t count,               FILE *restrict stream );<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p><strong>Return value<\/strong><\/p>\n<p>  Number of objects read successfully, which may be less than count if an error or end-of-file condition occurs.<\/p>\n<p>  If size or count is zero, fread returns zero and performs no other action.<\/p>\n<p>  fread does not distinguish between end-of-file and error, and callers must use feof and ferror to determine which occurred.<\/p><\/blockquote>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0430\u0441\u043d\u044b\u0439. \u041e\u0448\u0438\u0431\u043a\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043d\u0435 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422.\u0435. \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0430 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0431\u0430\u0439\u0442, \u0445\u043e\u0442\u044f \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n35-ispolzovanie-operatora--tam-gde-nuzhen-operator-\">\u041e\u0448\u0438\u0431\u043a\u0430 N35; \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 || \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0443\u0436\u0435\u043d \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &amp;&amp;<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression is always true. essl_sdio.c 209<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">esp_err_t essl_sdio_init(void *arg, uint32_t wait_ms) {   ....   \/\/ Set block sizes for functions 1 to given value (default value = 512).   if (ctx-&gt;block_size &gt; 0 || ctx-&gt;block_size &lt;= 2048) {     bs = ctx-&gt;block_size;   } else {     bs = 512;   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043a \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430\u043c, \u043d\u043e, \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043f\u043e \u0434\u0443\u0445\u0443 \u043e\u043d\u0430 \u0431\u043b\u0438\u0436\u0435 \u043a \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c. \u0414\u0443\u043c\u0430\u044e, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u0447\u0430\u0441\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u0412\u0435\u0434\u044c \u043d\u0435\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 0 \u0438\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 2048. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0431\u043b\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 512.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (ctx-&gt;block_size &gt; 0 &amp;&amp; ctx-&gt;block_size &lt;= 2048) {   bs = ctx-&gt;block_size; } else {   bs = 512; }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"oshibka-n35---n38-peremennaya-ne-izmenyaetsya\">\u041e\u0448\u0438\u0431\u043a\u0430 N35 \u2014 N38; \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;depth &lt;= 0&#8217; is always false. panic_handler.c 169<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void print_backtrace(const void *f, int core) {   XtExcFrame *frame = (XtExcFrame *) f;   int depth = 100;                                          \/\/ &lt;=   \/\/Initialize stk_frame with first frame of stack   esp_backtrace_frame_t stk_frame =     {.pc = frame-&gt;pc, .sp = frame-&gt;a1, .next_pc = frame-&gt;a0};   panic_print_str(&quot;\\r\\nBacktrace:&quot;);   print_backtrace_entry(esp_cpu_process_stack_pc(stk_frame.pc),                         stk_frame.sp);    \/\/Check if first frame is valid   bool corrupted =     !(esp_stack_ptr_is_sane(stk_frame.sp) &amp;&amp;       (esp_ptr_executable((void *)esp_cpu_process_stack_pc(stk_frame.pc)) ||        \/* Ignore the first corrupted PC in case of InstrFetchProhibited *\/        frame-&gt;exccause == EXCCAUSE_INSTR_PROHIBITED));    \/\/Account for stack frame that's already printed   uint32_t i = ((depth &lt;= 0) ? INT32_MAX : depth) - 1;      \/\/ &lt;=   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>depth<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 100, \u0438 \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0413\u0434\u0435-\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>V547 Expression &#8216;xAlreadyYielded == ((BaseType_t) 0)&#8217; is always true. event_groups.c 260<\/li>\n<li>V547 Expression &#8216;xAlreadyYielded == ((BaseType_t) 0)&#8217; is always true. tasks.c 1475<\/li>\n<li>V547 Expression &#8216;xAlreadyYielded == ((BaseType_t) 0)&#8217; is always true. tasks.c 1520<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"oshibka-n39-ispolzovanie-neinicializirovannogo-bufera\">\u041e\u0448\u0438\u0431\u043a\u0430 N39; \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V614 Potentially uninitialized buffer &#8216;k&#8217; used. Consider checking the second actual argument of the &#8216;sae_derive_keys&#8217; function. sae.c 854<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">int sae_process_commit(struct sae_data *sae) {   u8 k[SAE_MAX_PRIME_LEN];   if (sae-&gt;tmp == NULL ||       (sae-&gt;tmp-&gt;ec &amp;&amp; sae_derive_k_ecc(sae, k) &lt; 0) ||       (sae-&gt;tmp-&gt;dh &amp;&amp; sae_derive_k_ffc(sae, k) &lt; 0) ||       sae_derive_keys(sae, k) &lt; 0)     return ESP_FAIL;   return ESP_OK; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043b\u043e\u0433\u0438\u043a\u0435. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 <em>ec<\/em> \u0438 <em>dh<\/em> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 <em>k<\/em> \u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>sae_derive_keys<\/em> \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0430\u0447\u043d\u0451\u0442 \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n40-vsegda-lozhnoe-uslovie\">\u041e\u0448\u0438\u0431\u043a\u0430 N40; \u0412\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;bit_len == 32&#8217; is always false. spi_flash_ll.h 371<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static inline void spi_flash_ll_set_usr_address(spi_dev_t *dev, uint32_t addr,                                                 int bit_len) {   \/\/ The blank region should be all ones   if (bit_len &gt;= 32) {     dev-&gt;addr = addr;     dev-&gt;slv_wr_status = UINT32_MAX;   } else {     uint32_t padding_ones = (bit_len == 32? 0 : UINT32_MAX &gt;&gt; bit_len);     dev-&gt;addr = (addr &lt;&lt; (32 - bit_len)) | padding_ones;   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043b\u0435\u0433\u043a\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <em>bit_len == 32<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0430\u0441\u0442 \u043b\u043e\u0436\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b\u0448\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435-\u0438\u043b\u0438-\u0440\u0430\u0432\u043d\u043e (&gt;=), \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 (&gt;).<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n41-povtornoe-prisvaivanie\">\u041e\u0448\u0438\u0431\u043a\u0430 N41; \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V519 The &#8216;* pad_num&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 46, 48. touch_sensor_hal.c 48<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void touch_hal_get_wakeup_status(touch_pad_t *pad_num) {   uint32_t touch_mask = 0;   touch_ll_read_trigger_status_mask(&amp;touch_mask);   if (touch_mask == 0) {     *pad_num = -1;   }   *pad_num = (touch_pad_t)(__builtin_ffs(touch_mask) - 1); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u044f\u0432\u043d\u043e \u043e\u0448\u0438\u0431\u043e\u0447\u0435\u043d \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>else<\/em>. \u042f \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u043d\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void touch_hal_get_wakeup_status(touch_pad_t *pad_num) {   uint32_t touch_mask = 0;   touch_ll_read_trigger_status_mask(&amp;touch_mask);   if (touch_mask == 0) {     *pad_num = -1;   } else {     *pad_num = (touch_pad_t)(__builtin_ffs(touch_mask) - 1);   } }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"vyhod-za-granicu-massiva\">\u0412\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/h2>\n<p>  <\/p>\n<h3 id=\"oshibka-n42-nepravilnaya-granichnaya-proverka\">\u041e\u0448\u0438\u0431\u043a\u0430 N42; \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V557 Array overrun is possible. The value of &#8216;frame-&gt;exccause&#8217; index could reach 16. gdbstub_xtensa.c 132<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">int esp_gdbstub_get_signal(const esp_gdbstub_frame_t *frame) {   const char exccause_to_signal[] =     {4, 31, 11, 11, 2, 6, 8, 0, 6, 7, 0, 0, 7, 7, 7, 7};   if (frame-&gt;exccause &gt; sizeof(exccause_to_signal)) {     return 11;   }   return (int) exccause_to_signal[frame-&gt;exccause]; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430 1 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0414\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0431\u043e\u043b\u044c\u0448\u0435, \u0430 \u0431\u043e\u043b\u044c\u0448\u0435-\u0438\u043b\u0438-\u0440\u0430\u0432\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (frame-&gt;exccause &gt;= sizeof(exccause_to_signal)) {<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"oshibka-n43-dlinnyy-primer-oshibki-\">\u041e\u0448\u0438\u0431\u043a\u0430 N43; \u0414\u043b\u0438\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \ud83d\ude42<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0432 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>V557 Array overrun is possible. The value of &#8216;other_if&#8217; index could reach 3. mdns.c 2206<\/li>\n<li>V557 Array overrun is possible. The &#8216;_mdns_announce_pcb&#8217; function processes value &#8216;[0..3]&#8217;. Inspect the first argument. Check lines: 1674, 2213. mdns.c 1674<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">typedef enum mdns_if_internal {     MDNS_IF_STA = 0,     MDNS_IF_AP = 1,     MDNS_IF_ETH = 2,     MDNS_IF_MAX } mdns_if_t;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b <em>MDNS_IF_MAX<\/em> \u0440\u0430\u0432\u043d\u043e 3.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <em>mdns_server_s<\/em>. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 <em>interfaces<\/em> \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">typedef struct mdns_server_s {     struct {         mdns_pcb_t pcbs[MDNS_IP_PROTOCOL_MAX];     } interfaces[MDNS_IF_MAX];     const char * hostname;     const char * instance;     mdns_srv_item_t * services;     SemaphoreHandle_t lock;     QueueHandle_t action_queue;     mdns_tx_packet_t * tx_queue_head;     mdns_search_once_t * search_once;     esp_timer_handle_t timer_handle; } mdns_server_t;  mdns_server_t * _mdns_server = NULL;<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>_mdns_get_other_if<\/em>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 <em>MDNS_IF_MAX<\/em>. \u0422.\u0435. \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 3.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static mdns_if_t _mdns_get_other_if (mdns_if_t tcpip_if) {   if (tcpip_if == MDNS_IF_STA) {     return MDNS_IF_ETH;   } else if (tcpip_if == MDNS_IF_ETH) {      return MDNS_IF_STA;   }   return MDNS_IF_MAX; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0432\u043e\u0442, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u043e\u0448\u0438\u0431\u043e\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void _mdns_dup_interface(mdns_if_t tcpip_if) {     uint8_t i;     mdns_if_t other_if = _mdns_get_other_if (tcpip_if);     for (i=0; i&lt;MDNS_IP_PROTOCOL_MAX; i++) {         if (_mdns_server-&gt;interfaces[other_if].pcbs[i].pcb) {        \/\/ &lt;=             \/\/stop this interface and mark as dup             if (_mdns_server-&gt;interfaces[tcpip_if].pcbs[i].pcb) {                 _mdns_clear_pcb_tx_queue_head(tcpip_if, i);                 _mdns_pcb_deinit(tcpip_if, i);             }             _mdns_server-&gt;interfaces[tcpip_if].pcbs[i].state = PCB_DUP;             _mdns_announce_pcb(other_if, i, NULL, 0, true);          \/\/ &lt;=         }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>_mdns_get_other_if<\/em> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u0440\u043e\u0439\u043a\u0443. \u0417\u043d\u0430\u0447\u0438\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>other_if<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 \u0442\u0440\u0451\u043c. \u0418 \u0432\u043e\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (_mdns_server-&gt;interfaces[other_if].pcbs[i].pcb)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u043e\u043f\u0430\u0441\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>other_if, &#8212;<\/em> \u044d\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>_mdns_announce_pcb<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">_mdns_announce_pcb(other_if, i, NULL, 0, true);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void _mdns_announce_pcb(mdns_if_t tcpip_if,                                mdns_ip_protocol_t ip_protocol,                                mdns_srv_item_t ** services,                                size_t len, bool include_ip) {   mdns_pcb_t * _pcb = &amp;_mdns_server-&gt;interfaces[tcpip_if].pcbs[ip_protocol];   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441 3 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0438\u0437 3 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0410 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u2014 \u044d\u0442\u043e \u0434\u0432\u043e\u0439\u043a\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"nulevye-ukazateli\">\u041d\u0443\u043b\u0435\u0432\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438<\/h2>\n<p>  <\/p>\n<h3 id=\"oshibka-n44---n47-oshibka-ocheryodnosti-proverki-ukazateley\">\u041e\u0448\u0438\u0431\u043a\u0430 N44 \u2014 N47; \u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0447\u0435\u0440\u0451\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#8216;hapd-&gt;wpa_auth&#8217; pointer was utilized before it was verified against nullptr. Check lines: 106, 113. esp_hostap.c 106<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">bool hostap_deinit(void *data) {   struct hostapd_data *hapd = (struct hostapd_data *)data;    if (hapd == NULL) {     return true;   }    if (hapd-&gt;wpa_auth-&gt;wpa_ie != NULL) {     os_free(hapd-&gt;wpa_auth-&gt;wpa_ie);   }    if (hapd-&gt;wpa_auth-&gt;group != NULL) {     os_free(hapd-&gt;wpa_auth-&gt;group);   }    if (hapd-&gt;wpa_auth != NULL) {     os_free(hapd-&gt;wpa_auth);   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (hapd-&gt;wpa_auth-&gt;group != NULL) .... if (hapd-&gt;wpa_auth != NULL)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>hapd-&gt;wpa_auth<\/em> \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0442\u043e \u0432\u0441\u0451 \u043f\u043b\u043e\u0445\u043e. \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (hapd-&gt;wpa_auth != NULL) {   ....   if (hapd-&gt;wpa_auth-&gt;group != NULL)   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438: <\/p>\n<p>  <\/p>\n<ul>\n<li>V595 The &#8216;hapd-&gt;conf&#8217; pointer was utilized before it was verified against nullptr. Check lines: 118, 125. esp_hostap.c 118<\/li>\n<li>V595 The &#8216;sm&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1637, 1647. esp_wps.c 1637<\/li>\n<li>V595 The &#8216;sm&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1693, 1703. esp_wps.c 1693<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"oshibka-n48---n64-net-proverki-ukazatelya-posle-vydeleniya-pamyati\">\u041e\u0448\u0438\u0431\u043a\u0430 N48 \u2014 N64; \u041d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0438\u043b\u0438 \u043d\u0435\u0442. \u0422.\u0435. \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">dhcp_data = (struct dhcp *)malloc(sizeof(struct dhcp)); if (dhcp_data == NULL) {   return ESP_ERR_NO_MEM; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0437\u0430\u0431\u044b\u043b\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V522 There might be dereferencing of a potential null pointer &#8216;exp&#8217;. Check lines: 3470, 3469. argtable3.c 3470<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">TRex *trex_compile(const TRexChar *pattern,const TRexChar **error,int flags) {   TRex *exp = (TRex *)malloc(sizeof(TRex));   exp-&gt;_eol = exp-&gt;_bol = NULL;   exp-&gt;_p = pattern;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0432\u0438\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u043e\u043f\u0430\u0441\u043d\u0435\u0435, \u0447\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &quot;<a href=\"https:\/\/www.viva64.com\/ru\/b\/0558\/\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f malloc<\/a>&quot;.<\/p>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;s_ledc_fade_rec[speed_mode][channel]&#8217;. Check lines: 668, 667. ledc.c 668<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;environ&#8217;. Check lines: 108, 107. syscall_table.c 108<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;it&#8217;. Check lines: 150, 149. partition.c 150<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;eth&#8217;. Check lines: 167, 159. wpa_auth.c 167<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;pt&#8217;. Check lines: 222, 219. crypto_mbedtls-ec.c 222<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;attr&#8217;. Check lines: 88, 73. wps.c 88<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 725, 724. coap_mbedtls.c 725<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 3504, 3503. argtable3.c 3504<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 496, 495. mqtt_client.c 496<\/li>\n<li>V575 The potential null pointer is passed into &#8216;strcpy&#8217; function. Inspect the first argument. Check lines: 451, 450. transport_ws.c 451<\/li>\n<li>V769 The &#8216;buffer&#8217; pointer in the &#8216;buffer + n&#8217; expression could be nullptr. In such case, resulting value will be senseless and it should not be used. Check lines: 186, 181. cbortojson.c 186<\/li>\n<li>V769 The &#8216;buffer&#8217; pointer in the &#8216;buffer + len&#8217; expression could be nullptr. In such case, resulting value will be senseless and it should not be used. Check lines: 212, 207. cbortojson.c 212<\/li>\n<li>V769 The &#8216;out&#8217; pointer in the &#8216;out ++&#8217; expression could be nullptr. In such case, resulting value will be senseless and it should not be used. Check lines: 233, 207. cbortojson.c 233<\/li>\n<li>V769 The &#8216;parser-&gt;m_bufferPtr&#8217; pointer in the expression equals nullptr. The resulting value of arithmetic operations on this pointer is senseless and it should not be used. xmlparse.c 2090<\/li>\n<li>V769 The &#8216;signature&#8217; pointer in the &#8216;signature + curve-&gt;prime_len&#8217; expression could be nullptr. In such case, resulting value will be senseless and it should not be used. Check lines: 4112, 4110. dpp.c 4112<\/li>\n<li>V769 The &#8216;key&#8217; pointer in the &#8216;key + 16&#8217; expression could be nullptr. In such case, resulting value will be senseless and it should not be used. Check lines: 634, 628. eap_mschapv2.c 634<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"oshibka-n65-n66-net-proverki-ukazatelya-posle-vydeleniya-pamyati-pokazatelnyy-sluchay\">\u041e\u0448\u0438\u0431\u043a\u0430 N65, N66; \u041d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 (\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439)<\/h3>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0443, \u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0432\u044b\u0448\u0435, \u043d\u043e \u043e\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438 \u044f\u0440\u043a\u0430\u044f. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>realloc<\/em>.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer &#8216;exp-&gt;_nodes&#8217; is lost. Consider assigning realloc() to a temporary pointer. argtable3.c 3008<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int trex_newnode(TRex *exp, TRexNodeType type) {   TRexNode n;   int newid;   n.type = type;   n.next = n.right = n.left = -1;   if(type == OP_EXPR)     n.right = exp-&gt;_nsubexpr++;   if(exp-&gt;_nallocated &lt; (exp-&gt;_nsize + 1)) {     exp-&gt;_nallocated *= 2;     exp-&gt;_nodes = (TRexNode *)realloc(exp-&gt;_nodes,                                       exp-&gt;_nallocated * sizeof(TRexNode));   }   exp-&gt;_nodes[exp-&gt;_nsize++] = n; \/\/ NOLINT(clang-analyzer-unix.Malloc)   newid = exp-&gt;_nsize - 1;   return (int)newid; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>realloc<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 <em>NULL<\/em>, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <em>exp-&gt;_nodes<\/em>. \u0412\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0443\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>realloc<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 <em>NULL<\/em>, \u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u043f\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e. \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0443 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">exp-&gt;_nodes[exp-&gt;_nsize++] = n;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>exp-&gt;_nsize++<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c, \u0438, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0441\u0432\u043e\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u043a\u0430\u043a \u043d\u0438 \u0432 \u0447\u0451\u043c \u043d\u0435 \u0431\u044b\u0432\u0430\u043b\u043e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u0440\u0443\u0448\u0435\u043d\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c.<\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer &#8216;m_context-&gt;pki_sni_entry_list&#8217; is lost. Consider assigning realloc() to a temporary pointer. coap_mbedtls.c 737<\/p>\n<p>  <\/p>\n<h2 id=\"prochie-oshibki\">\u041f\u0440\u043e\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h2>\n<p>  <\/p>\n<h3 id=\"oshibka-n67-lishniy-ili-nevernyy-kod\">\u041e\u0448\u0438\u0431\u043a\u0430 N67; \u041b\u0438\u0448\u043d\u0438\u0439 \u0438\u043b\u0438 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;ret != 0&#8217; is always false. sdio_slave.c 394<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">esp_err_t sdio_slave_start(void) {   ....   critical_exit_recv();   ret = ESP_OK;   if (ret != ESP_OK) return ret;    sdio_slave_hal_set_ioready(context.hal, true);   return ESP_OK; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0434\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">esp_err_t sdio_slave_start(void) {   ....   critical_exit_recv();   sdio_slave_hal_set_ioready(context.hal, true);   return ESP_OK; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442, \u043c\u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u043e, \u0447\u0442\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e. \u0410 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0441\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0439 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0439. \u041e\u0434\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u2014 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u043e\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n68-lishniy-ili-nevernyy-kod\">\u041e\u0448\u0438\u0431\u043a\u0430 N68; \u041b\u0438\u0448\u043d\u0438\u0439 \u0438\u043b\u0438 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;err != 0&#8217; is always false. sdio_slave_hal.c 96<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static esp_err_t sdio_ringbuf_send(....) {   uint8_t* get_ptr = ....;   esp_err_t err = ESP_OK;   if (copy_callback) {     (*copy_callback)(get_ptr, arg);   }   if (err != ESP_OK) return err;    buf-&gt;write_ptr = get_ptr;   return ESP_OK; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0432\u0441\u0451 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>err<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u043b\u0438 \u0435\u0451 \u0437\u0430\u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<h3 id=\"oshibka-n69-ispolzovanie-potencialno-neinicializirovannogo-bufera\">\u041e\u0448\u0438\u0431\u043a\u0430 N69; \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V614 Potentially uninitialized buffer &#8216;seq&#8217; used. Consider checking the first actual argument of the &#8216;strlen&#8217; function. linenoise.c 435<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void refreshShowHints(struct abuf *ab, struct linenoiseState *l, int plen) {     char seq[64];     if (hintsCallback &amp;&amp; plen+l-&gt;len &lt; l-&gt;cols) {         int color = -1, bold = 0;         char *hint = hintsCallback(l-&gt;buf,&amp;color,&amp;bold);         if (hint) {             int hintlen = strlen(hint);             int hintmaxlen = l-&gt;cols-(plen+l-&gt;len);             if (hintlen &gt; hintmaxlen) hintlen = hintmaxlen;             if (bold == 1 &amp;&amp; color == -1) color = 37;             if (color != -1 || bold != 0)                 snprintf(seq,64,&quot;\\033[%d;%d;49m&quot;,bold,color);             abAppend(ab,seq,strlen(seq));                       \/\/ &lt;=             abAppend(ab,hint,hintlen);             if (color != -1 || bold != 0)                 abAppend(ab,&quot;\\033[0m&quot;,4);             \/* Call the function to free the hint returned. *\/             if (freeHintsCallback) freeHintsCallback(hint);         }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0443\u0444\u0435\u0440 <em>seq<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d! \u041e\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (color != -1 || bold != 0)   snprintf(seq,64,&quot;\\033[%d;%d;49m&quot;,bold,color);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0431\u0443\u0444\u0435\u0440 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a \u0441\u0442\u0440\u043e\u043a\u0435 <em>ab<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (color != -1 || bold != 0) {   snprintf(seq,64,&quot;\\033[%d;%d;49m&quot;,bold,color);   abAppend(ab,seq,strlen(seq)); }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"oshibka-n70-strannaya-maska\">\u041e\u0448\u0438\u0431\u043a\u0430 N70; \u0421\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u043c\u0430\u0441\u043a\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression is always false. tasks.c 896<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#ifndef portPRIVILEGE_BIT   #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 ) #endif  static void prvInitialiseNewTask(...., UBaseType_t uxPriority, ....) {   StackType_t *pxTopOfStack;   UBaseType_t x;    #if (portNUM_PROCESSORS &lt; 2)   xCoreID = 0;   #endif    #if( portUSING_MPU_WRAPPERS == 1 )     \/* Should the task be created in privileged mode? *\/     BaseType_t xRunPrivileged;     if( ( uxPriority &amp; portPRIVILEGE_BIT ) != 0U )     {       xRunPrivileged = pdTRUE;     }     else     {       xRunPrivileged = pdFALSE;     }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 <em>portPRIVILEGE_BIT<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u043c\u0430\u0441\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if( ( uxPriority &amp; portPRIVILEGE_BIT ) != 0U )<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"oshibka-n71-utechka-pamyati\">\u041e\u0448\u0438\u0431\u043a\u0430 N71, \u0423\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V773 The function was exited without releasing the &#8216;sm&#8217; pointer. A memory leak is possible. esp_wpa2.c 753<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static int eap_peer_sm_init(void) {   int ret = 0;   struct eap_sm *sm;   ....   sm = (struct eap_sm *)os_zalloc(sizeof(*sm));   if (sm == NULL) {     return ESP_ERR_NO_MEM;   }    s_wpa2_data_lock = xSemaphoreCreateRecursiveMutex();   if (!s_wpa2_data_lock) {     wpa_printf(MSG_ERROR, &quot;.......&quot;);  \/\/ NOLINT(clang-analyzer-unix.Malloc)     return ESP_ERR_NO_MEM;             \/\/ &lt;=   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>xSemaphoreCreateRecursiveMutex<\/em> \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u044c\u044e\u0442\u0435\u043a\u0441, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>eap_peer_sm_init<\/em> \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0443\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438. \u041a\u0430\u043a \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>os_free<\/em> \u0434\u043b\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">  s_wpa2_data_lock = xSemaphoreCreateRecursiveMutex();   if (!s_wpa2_data_lock) {     wpa_printf(MSG_ERROR, &quot;.......&quot;);     os_free(sm);     return ESP_ERR_NO_MEM;   }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Clang \u0442\u043e\u0436\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0430\u0432\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0438 \u0434\u0430\u0436\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0430\u0432\u0438\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ NOLINT(clang-analyzer-unix.Malloc)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u043c\u043d\u0435 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0435\u0434\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0430\u0432\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0438 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u0435\u0441\u044c\u043c\u0430 \u043c\u043d\u043e\u0433\u043e. \u0410 \u044d\u0442\u043e \u0432\u0435\u0434\u044c \u0431\u044b\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0433\u043b\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043e\u0442\u0447\u0451\u0442\u0430. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u042e\u0440\u0438\u0439 \u041f\u043e\u043f\u043e\u0432 \u043f\u0440\u0438\u043c\u0435\u0442 \u044d\u0441\u0442\u0430\u0444\u0435\u0442\u0443 \u0438 \u043e\u043f\u0438\u0448\u0435\u0442 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 :).<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u0440\u0430\u043d\u043d\u0435\u043c \u044d\u0442\u0430\u043f\u0435, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u0438\u0445 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435;<\/li>\n<li>\u041d\u0430\u0445\u043e\u0434\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0433\u043b\u0443\u043f\u044b\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043b\u044f\u043f\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0432\u044b \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u043e\u0431\u0437\u043e\u0440 \u043a\u043e\u0434\u0430 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432;<\/li>\n<li>\u041b\u0443\u0447\u0448\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0438\u0445 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u043a\u043e\u0434;<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u044e\u0431\u0430\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u0434\u0430, \u2014 \u044d\u0442\u043e \u0437\u0434\u043e\u0440\u043e\u0432\u043e. \u041a\u0430\u0436\u0434\u0430\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e-\u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u0451\u0442 \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0440\u0438\u0441\u043a\u0438 \u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043e\u043a.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e <a href=\"https:\/\/www.viva64.com\/ru\/pvs-studio-download\/?promo=pvs_ak\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/a> \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u044f\u0445, \u0442\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043c\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/www.viva64.com\/ru\/b\/0614\/\">\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432<\/a> \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0439. \u041d\u0435 \u0436\u0434\u0438\u0442\u0435, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u0432\u0430\u0440\u043d\u044b\u0439 \u0431\u0430\u0433 \u0441\u044a\u0435\u0441\u0442 \u0432\u0430\u0448\u0443 \u043d\u043e\u0433\u0443, \u043d\u0430\u0447\u043d\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c PVS-Studio \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<p>  <\/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 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Andrey Karpov. <a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/538286\/\">Espressif IoT Development Framework: 71 Shots in the Foot<\/a>.<\/p>\n<\/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=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/538292\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/538292\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fe3\/e2d\/b35\/fe3e2db3546a1ccb216647dfbe6849b5.png\" alt=\"0790_Espressif_IoT_Development_Framework_ru\/image1.png\"><br \/>  \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u043d\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 Espressif IoT Development Framework. \u041e\u043d \u043d\u0430\u0448\u0451\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0441\u044f, \u0441\u043c\u043e\u0433 \u0431\u044b \u0435\u0451 \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u043a\u0430 \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442, \u0437\u0430\u0442\u043e \u043d\u0430\u0448\u0451\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445. \u041f\u043e \u043c\u043e\u0442\u0438\u0432\u0430\u043c \u044d\u0442\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e IoT \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 &quot;\u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0432\u0430\u043c \u0432 \u043d\u043e\u0433\u0443&quot;.<\/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-316654","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316654","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=316654"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316654\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}