{"id":317390,"date":"2021-02-03T09:00:24","date_gmt":"2021-02-03T09:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=317390"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=317390","title":{"rendered":"\u0412\u044b\u044f\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 GTK 4 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio"},"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\/webt\/lw\/ze\/zm\/lwzezm314gglzxufoodz9sapfji.png\" alt=\"0793_GTK_4_continue_ru\/image1.png\"><\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u043d\u0435\u0434\u0430\u0432\u043d\u044e\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 PVS-Studio \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 GTK 4 \u0438 \u043e \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043e\u0442\u0447\u0451\u0442\u043e\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e. \u0418 \u043a\u0430\u043a \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u0448\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"u-proekta-gtk-4-horoshee-kachestvo-koda\">\u0423 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 GTK 4 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 &quot;<a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/538292\/\">Espressif IoT Development Framework: 71 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0432 \u043d\u043e\u0433\u0443<\/a>&quot;. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0443\u0441\u044c 21 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0432 \u0447\u0435\u0441\u0442\u044c 2021 \u0433\u043e\u0434\u0430 :). \u041f\u043b\u044e\u0441, \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438 \u043d\u0430\u0434\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 GTK 4, \u0438 \u0447\u0442\u043e \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u0435\u0441\u044c\u043c\u0430 \u043c\u0430\u043b\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d, \u0445\u043e\u0440\u043e\u0448\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438, \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u0430\u043a Clang static analysis tool, Coverity, AddressSanitizer, UndefinedBehavior Sanitizer. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0441 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u0434\u0430 \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e, \u0438 \u043d\u0430\u0439\u0442\u0438 \u0445\u043e\u0442\u044f-\u0431\u044b \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u041e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 GTK 4 \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0451\u0442\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0421\u0432\u044f\u0442\u043e\u0441\u043b\u0430\u0432\u0430 \u0420\u0430\u0437\u043c\u044b\u0441\u043b\u043e\u0432\u0430 &quot;<a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/536046\/\">GTK: \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0432 \u0446\u0438\u0444\u0440\u0430\u0445<\/a>&quot;. \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0432 \u043e\u0442\u0447\u0451\u0442\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c 581 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0438 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430 \u0442\u0440\u0435\u0442\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u044f \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u0442\u0430\u043b). 581 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044c \u043e\u0434\u043d\u0430 \u0432\u044b\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: \u0440\u0430\u0437\u0432\u0435 \u043d\u0435 \u043c\u0430\u043b\u043e\u0432\u0430\u0442\u043e? \u042d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u0440\u0430\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u044e, \u0447\u0442\u043e \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c. \u0418 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0438\u0437-\u0437\u0430 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u0440\u0438\u0447\u0451\u043c, \u043d\u0435\u043b\u044c\u0437\u044f \u0434\u0430\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435. \u041e\u043d \u0432\u0440\u043e\u0434\u0435, \u043a\u0430\u043a \u0438 \u043f\u0440\u0430\u0432, \u043d\u043e \u0442\u043e\u043b\u043a\u0443 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u0442. \u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">bool var; var = true; if (!var &amp;&amp; foo)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u044b \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0417\u0430\u0447\u0435\u043c \u0442\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c? \u0411\u044b\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0433\u0434\u0435-\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 var? \u041a\u043e\u0434 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u0435\u043d, \u0438 \u0432\u044b \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0432\u044b\u0434\u0430\u0441\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 &quot;A part of conditional expression is always false: !var&quot;. \u041e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435? \u0414\u0430.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b. \u0412\u043e\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0439 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u043a\u043e\u0434 \u0438\u0437 GTK 4, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0432 \u043d\u0451\u043c \u0443\u0436\u0435 \u043d\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">gboolean debug_enabled;  #ifdef G_ENABLE_DEBUG   debug_enabled = TRUE; #else   debug_enabled = FALSE; #endif .... if (!debug_enabled &amp;&amp; !keys[i].always_enabled)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: V560 [CWE-570] A part of conditional expression is always false: !debug_enabled. gdk.c 281<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043a\u0430\u043a \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u0442\u043e\u043b\u043a\u0443 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0435\u0442. \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u043d, \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u0440. \u0418 \u0447\u0430\u0441\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e \u043d\u0435\u0442. \u041a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"https:\/\/www.viva64.com\/ru\/b\/0789\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u0438\u0445 \u043b\u0438\u0448\u043d\u0438\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439: \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434, \u0442\u043e\u0447\u0435\u0447\u043d\u043e \u043f\u043e\u0434\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u043c\u0435\u0447\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"zamechennye-oshibki\">\u0417\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438. \u0421 \u043d\u0438\u0445 \u0438 \u043d\u0430\u0447\u043d\u0451\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"opechatki\">\u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0438<\/h3>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1. \u041a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0432 \u0446\u0438\u043a\u043b\u0435<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void gsk_vulkan_image_upload_regions (GskVulkanImage    *self,                                  GskVulkanUploader *uploader,                                  guint              num_regions,                                  GskImageRegion    *regions) {   ....   for (int i = 0; i &lt; num_regions; i++)   {     m = mem + offset;     if (regions[i].stride == regions[i].width * 4)     {       memcpy (m, regions[i].data, regions[i].stride * regions[i].height);     }     else     {       for (gsize r = 0; r &lt; regions[i].height; i++)          \/\/ &lt;=         memcpy (m + r * regions[i].width * 4,                 regions[i].data + r * regions[i].stride, regions[i].width * 4);     }     ....   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V533 [CWE-691] It is likely that a wrong variable is being incremented inside the &#8216;for&#8217; operator. Consider reviewing &#8216;i&#8217;. gskvulkanimage.c 721<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>r<\/em>, \u0430 <em>i<\/em>. \u0427\u0442\u043e-\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u044f\u0441\u043d\u044f\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. \u042d\u0442\u043e \u0437\u043e\u043b\u043e\u0442\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u043a\u0430!<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2. \u0426\u0438\u043a\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f<\/strong><\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0433 \u043d\u0430\u0447\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0446\u0438\u043a\u043b \u0441 \u043d\u0435\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. \u0418 \u0432\u0441\u0451 \u0431\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c, \u043a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>memcpy<\/em> \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u0431\u044b \u0447\u0442\u043e-\u0442\u043e \u043d\u0443 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0443\u0434\u0430, \u043a\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e. \u0422.\u0435. \u0432\u0441\u0451 \u0431\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Segmentation_fault\">Segmentation fault<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0437\u0434\u0435\u0441\u044c, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0446\u0438\u043a\u043b \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">GtkCssValue * _gtk_css_border_value_parse (GtkCssParser           *parser,                              GtkCssNumberParseFlags  flags,                              gboolean                allow_auto,                              gboolean                allow_fill) {   ....   guint i;   ....   for (; i &lt; 4; i++)        \/\/ &lt;=   {     if (result-&gt;values[(i - 1) &gt;&gt; 1])       result-&gt;values[i] = _gtk_css_value_ref (result-&gt;values[(i - 1) &gt;&gt; 1]);   }    result-&gt;is_computed = TRUE;    for (; i &lt; 4; i++)        \/\/ &lt;=     if (result-&gt;values[i] &amp;&amp; !gtk_css_value_is_computed (result-&gt;values[i]))     {       result-&gt;is_computed = FALSE;       break;     }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V621 [CWE-835] Consider inspecting the &#8216;for&#8217; operator. It&#8217;s possible that the loop will be executed incorrectly or won&#8217;t be executed at all. gtkcssbordervalue.c 221<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 <em>i<\/em> \u0440\u0430\u0432\u043d\u043e 4. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0442\u043e\u0440\u043e\u0439 \u0446\u0438\u043a\u043b \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438. \u041d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0441\u0431\u0440\u043e\u0441\u0430 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u0432 \u043d\u043e\u043b\u044c.<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3. \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void gtk_list_base_class_init (GtkListBaseClass *klass) {   ....   properties[PROP_ORIENTATION] =     g_param_spec_enum (&quot;orientation&quot;,                        P_(&quot;Orientation&quot;),                        P_(&quot;The orientation of the orientable&quot;),                        GTK_TYPE_ORIENTATION,                        GTK_ORIENTATION_VERTICAL,                        G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY |                                            G_PARAM_EXPLICIT_NOTIFY);   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V501 There are identical sub-expressions &#8216;G_PARAM_EXPLICIT_NOTIFY&#8217; to the left and to the right of the &#8216;|&#8217; operator. gtklistbase.c 1151<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u0430\u0441\u043a\u0438 \u0434\u0432\u0430\u0436\u0434\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 <em>G_PARAM_EXPLICIT_NOTIFY<\/em>. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0438 \u043c\u0430\u0441\u043a\u0435 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0435 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0438\u0442\u044b.<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4. \u041f\u0443\u0442\u0430\u043d\u0438\u0446\u0430 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>post_insert_fixup<\/em>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 <em>char_count_delta<\/em> \u0438 <em>line_count_delta<\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void    post_insert_fixup    (GtkTextBTree     *tree,                                      GtkTextLine      *insert_line,                                      int               char_count_delta,                                      int               line_count_delta);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c, \u0438\u0437\u0443\u0447\u0438\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void _gtk_text_btree_insert (GtkTextIter *iter,                         const char *text,                         int          len) {   ....   int line_count_delta;                \/* Counts change to total number of                                         * lines in file.                                         *\/    int char_count_delta;                \/* change to number of chars *\/   ....   post_insert_fixup (tree, line, line_count_delta, char_count_delta);   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V764 [CWE-683] Possible incorrect order of arguments passed to &#8216;post_insert_fixup&#8217; function: &#8216;line_count_delta&#8217; and &#8216;char_count_delta&#8217;. gtktextbtree.c 1230<\/p>\n<p>  <\/p>\n<p>\u0418\u0437-\u0437\u0430 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043d\u044b \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0442\u0440\u0435\u0442\u0438\u0439 \u0438 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u0442\u0438\u043f\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u043a\u043e\u0434 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u043d\u0451\u043c \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412 PVS-Studio \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u044f\u0432\u043b\u044f\u044e\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043d\u043e \u0430\u0431\u0441\u0443\u0440\u0434\u043d\u044b\u0435 \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u044d\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0440\u0430\u043d\u043d\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043f\u0440\u0438 \u043e\u0431\u0437\u043e\u0440\u0435 \u043a\u043e\u0434\u0430 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445, \u0430 \u043d\u0435 \u0432\u044b\u0438\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043a\u0430 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e <a href=\"https:\/\/www.viva64.com\/ru\/pvs-studio-download\/?promo=pvs_ak\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c<\/a> \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447.<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5. \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/strong><\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static guint translate_keysym (GdkX11Keymap   *keymap_x11,                   guint           hardware_keycode,                   int             group,                   GdkModifierType state,                   int            *effective_group,                   int            *effective_level) {  .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0432\u044b\u0448\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static gboolean gdk_x11_keymap_translate_keyboard_state (GdkKeymap       *keymap,                                          guint            hardware_keycode,                                          GdkModifierType  state,                                          int              group,                                          guint           *keyval,                                          int             *effective_group,                                          int             *level,                                          GdkModifierType *consumed_modifiers) {   ....   tmp_keyval = translate_keysym (keymap_x11, hardware_keycode,                                  group, state,                                  level, effective_group);   \/\/ &lt;=   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V764 [CWE-683] Possible incorrect order of arguments passed to &#8216;translate_keysym&#8217; function: &#8216;level&#8217; and &#8216;effective_group&#8217;. gdkkeys-x11.c 1386<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u0443\u0442\u0430\u043d\u043e \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439. \u0412\u043d\u043e\u0432\u044c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430: \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043d\u044b \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b <em>level<\/em> \u0438 <em>effective_group<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0448\u0438\u043b\u0441\u044f <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 PVS-Studio<\/a>, \u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f :). \u041d\u0435\u0443\u0436\u0435\u043b\u0438 \u0432\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432\u044b\u0438\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0433\u043b\u0430\u0437\u0430\u043c\u0438? \u0418\u043b\u0438, \u043d\u0435 \u0434\u0430\u0439 \u0431\u043e\u0433, \u0441\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c\u0438 \u0432 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0435?<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N6. \u0417\u0430\u0431\u044b\u043b\u0438 \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u0443 (*)<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">gboolean gtk_check_compact_table (...., int n_compose, ....) {   ....   guint16 *seq_index;   ....    seq_index = bsearch (compose_buffer,                        table-&gt;data,                        table-&gt;n_index_size,                        sizeof (guint16) * table-&gt;n_index_stride,                        compare_seq_index);    if (!seq_index)     return FALSE;    if (seq_index &amp;&amp; n_compose == 1)     return TRUE;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V560 [CWE-571] A part of conditional expression is always true: seq_index. gtkimcontextsimple.c 475<\/p>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <em>seq_index<\/em> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u0432\u044b\u0448\u0435 \u0438 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u042f \u043d\u0435 \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u043d\u043e \u0440\u0438\u0441\u043a\u043d\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0435 \u0441\u0430\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043d \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0437\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. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \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 (!seq_index)   return FALSE;  if (*seq_index &amp;&amp; n_compose == 1)   return TRUE;<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N7-N9. \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void gtk_message_dialog_init (GtkMessageDialog *dialog) {   GtkMessageDialogPrivate *priv = ....;   ....   priv-&gt;has_primary_markup = FALSE;   priv-&gt;has_secondary_text = FALSE;   priv-&gt;has_primary_markup = FALSE;   priv-&gt;has_secondary_text = FALSE;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p>  <\/p>\n<ul>\n<li>V519 [CWE-563] The &#8216;priv-&gt;has_primary_markup&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 262, 264. gtkmessagedialog.c 264<\/li>\n<li>V519 [CWE-563] The &#8216;priv-&gt;has_secondary_text&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 263, 265. gtkmessagedialog.c 265<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0440\u0430\u0437\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">priv-&gt;has_primary_markup = FALSE; priv-&gt;has_secondary_text = FALSE;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u043b\u043e\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0438\u0448\u043d\u0438\u0439. \u0410 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0430\u0431\u044b\u043b\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043f\u0430\u0440\u0430 \u0442\u0430\u043a\u0438\u0445 \u0436\u0435 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<ul>\n<li>V519 [CWE-563] The &#8216;self-&gt;state&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2851, 2855. gdkevents.c 2855<\/li>\n<li>V519 [CWE-563] The &#8216;display-&gt;width&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2635, 2640. gtktextlayout.c 2640<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"problemy-s-nulevymi-ukazatelyami\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438<\/h3>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N10. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static gboolean on_flash_timeout (GtkInspectorWindow *iw) {   iw-&gt;flash_count++;    gtk_highlight_overlay_set_color (GTK_HIGHLIGHT_OVERLAY (iw-&gt;flash_overlay),                                &amp;(GdkRGBA) {                                     0.0, 0.0, 1.0,                                    (iw &amp;&amp; iw-&gt;flash_count % 2 == 0) ? 0.0 : 0.2                                });   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 [CWE-476] The &#8216;iw&#8217; pointer was utilized before it was verified against nullptr. Check lines: 194, 199. inspect-button.c 194<\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>iw<\/em> \u0441\u043c\u0435\u043b\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430. \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0438\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u042d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">(iw &amp;&amp; iw-&gt;flash_count % 2 == 0)<\/code><\/pre>\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, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (iw)   iw-&gt;flash_count++;  gtk_highlight_overlay_set_color (GTK_HIGHLIGHT_OVERLAY (iw-&gt;flash_overlay),                              &amp;(GdkRGBA) {                                   0.0, 0.0, 1.0,                                  (iw &amp;&amp; iw-&gt;flash_count % 2 == 0) ? 0.0 : 0.2                              });<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0430\u0432\u043a\u0438 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e :). \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">GTK_HIGHLIGHT_OVERLAY (iw-&gt;flash_overlay)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u044f \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0443 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e \u044d\u0441\u0442\u0430\u0444\u0435\u0442\u0443 \u0430\u0432\u0442\u043e\u0440\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N11. \u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void cups_dispatch_watch_finalize (GSource *source) {   GtkPrintCupsDispatchWatch *dispatch;   ....   const char *username;   char         hostname[HTTP_MAX_URI];   char        *key;    httpGetHostname (dispatch-&gt;request-&gt;http, hostname, sizeof (hostname));   if (is_address_local (hostname))     strcpy (hostname, &quot;localhost&quot;);    if (dispatch-&gt;backend-&gt;username != NULL)                     \/\/ &lt;=     username = dispatch-&gt;backend-&gt;username;                    \/\/ &lt;=   else     username = cupsUser ();    key = g_strconcat (username, &quot;@&quot;, hostname, NULL);   GTK_NOTE (PRINTING,       g_print (&quot;CUPS backend: removing stored password for %s\\n&quot;, key));   g_hash_table_remove (dispatch-&gt;backend-&gt;auth, key);          \/\/ &lt;=   g_free (key);    if (dispatch-&gt;backend)                                       \/\/ &lt;=     dispatch-&gt;backend-&gt;authentication_lock = FALSE;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 [CWE-476] The &#8216;dispatch-&gt;backend&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1603, 1613. gtkprintbackendcups.c 1603<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 &quot;\u0431\u0435\u0441\u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0439&quot; \u043a\u043e\u0434 :). \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>dispatch-&gt;backend<\/em> \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 (\u0441\u043c. \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043a\u043e\u0434\u0430, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438). \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0436\u0435 \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c-\u0442\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c! \u0418 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (dispatch-&gt;backend)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u0443\u0436\u0435 \u043f\u043e\u0437\u0434\u043d\u043e :).<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N12. \u041d\u0435\u0442 \u0437\u0430\u0449\u0438\u0442\u044b, \u0435\u0441\u043b\u0438 \u043e\u0431\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0431\u0443\u0434\u0443\u0442 \u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static GskRenderNode * gtk_snapshot_collect_blend_top (GtkSnapshot      *snapshot,                                 GtkSnapshotState *state,                                 GskRenderNode   **nodes,                                 guint             n_nodes) {   GskRenderNode *bottom_node, *top_node, *blend_node;   GdkRGBA transparent = { 0, 0, 0, 0 };    top_node = gtk_snapshot_collect_default (snapshot, state, nodes, n_nodes);   bottom_node = state-&gt;data.blend.bottom_node != NULL               ? gsk_render_node_ref (state-&gt;data.blend.bottom_node)               : NULL;    g_assert (top_node != NULL || bottom_node != NULL);    if (top_node == NULL)     top_node = gsk_color_node_new (&amp;transparent, &amp;bottom_node-&gt;bounds);   if (bottom_node == NULL)     bottom_node = gsk_color_node_new (&amp;transparent, &amp;top_node-&gt;bounds);   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>V595 [CWE-476] The &#8216;bottom_node&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1189, 1190. gtksnapshot.c 1189<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 <em>top_node<\/em> \u0438 <em>bottom_node<\/em> \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">g_assert (top_node != NULL || bottom_node != NULL);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u0440\u0435\u043b\u0438\u0437\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 <em>g_assert<\/em> \u0440\u0430\u0441\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u043f\u0443\u0441\u0442\u043e\u0442\u0443. \u041d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u044f\u0432\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (top_node == NULL &amp;&amp; bottom_node == NULL) {   g_assert (false);   return NULL; }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"neudachnye-ili-lishnie-proverki\">\u041d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0435 \u0438\u043b\u0438 \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N13. \u041b\u0438\u0448\u043d\u044f\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void stash_desktop_startup_notification_id (void) {   const char *desktop_startup_id;    desktop_startup_id = g_getenv (&quot;DESKTOP_STARTUP_ID&quot;);   if (desktop_startup_id &amp;&amp; *desktop_startup_id != '\\0')     {       if (!g_utf8_validate (desktop_startup_id, -1, NULL))         g_warning (&quot;DESKTOP_STARTUP_ID contains invalid UTF-8&quot;);       else         startup_notification_id =           g_strdup (desktop_startup_id ? desktop_startup_id : &quot;&quot;);     }   g_unsetenv (&quot;DESKTOP_STARTUP_ID&quot;); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 [CWE-571] Expression &#8216;desktop_startup_id&#8217; is always true. gdk.c 176<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0438 \u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c. \u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u043e\u0434\u0430, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u043f\u0440\u0430\u0432\u043a\u0435.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0443\u0434\u0430\u043b\u0438\u0432 \u0432\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">desktop_startup_id = g_getenv (&quot;DESKTOP_STARTUP_ID&quot;); if (desktop_startup_id &amp;&amp; *desktop_startup_id != '\\0')   {     if (!g_utf8_validate (desktop_startup_id, -1, NULL))       g_warning (&quot;DESKTOP_STARTUP_ID contains invalid UTF-8&quot;);     else       startup_notification_id = g_strdup (desktop_startup_id);   }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N14. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>  <\/p>\n<p>\u041b\u0438\u0448\u043d\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0435\u0437\u0434\u0435 \u043c\u043d\u043e\u0433\u043e, \u043f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u043e \u0440\u0435\u0434\u043a\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0427\u0430\u0449\u0435 \u044d\u0442\u043e \u043d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434. \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u044f \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u044b\u0435\/\u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u043f\u043e\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u041c\u043e\u0436\u043d\u043e \u043d\u0430 \u0440\u0430\u043d\u043d\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0434\u0435\u043b\u0430\u044f \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u0438\u0437\u044f\u0449\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#define MAX_LIST_SIZE 1000  static void gtk_recent_manager_real_changed (GtkRecentManager *manager) {   ....   int age;   int max_size = MAX_LIST_SIZE;   ....   .... \/\/ \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f max_size \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c.   ....   if (age == 0 || max_size == 0 || !enabled)   {     g_bookmark_file_free (priv-&gt;recent_items);     priv-&gt;recent_items = g_bookmark_file_new ();     priv-&gt;size = 0;   }   else   {     if (age &gt; 0)       gtk_recent_manager_clamp_to_age (manager, age);     if (max_size &gt; 0)       gtk_recent_manager_clamp_to_size (manager, max_size);   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 [CWE-571] Expression &#8216;max_size &gt; 0&#8217; is always true. gtkrecentmanager.c 480<\/p>\n<p>  <\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>max_size<\/em> \u043f\u043e\u0441\u043b\u0435 \u0435\u0451 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u042d\u0442\u043e \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c, \u0442\u0430\u043a \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043b\u043e\u0433\u0438\u043a\u0435 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0431\u044b\u043b\u0438 \u0433\u0434\u0435-\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong> \u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441: \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f &quot;max_size == 0&quot;? \u041e\u043d\u043e \u0435\u0441\u0442\u044c. \u041f\u0440\u043e\u0441\u0442\u043e \u044f \u0435\u0433\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u043f\u0440\u0438 \u0431\u0435\u0433\u043b\u043e\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u043e\u0442\u0447\u0451\u0442\u0430 \u0438 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u043d\u0430 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0412\u043e\u0442 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: V560 [CWE-570] A part of conditional expression is always false: max_size == 0. gtkrecentmanager.c 470.<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N15, N16. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void action_handle_method (GtkAtSpiContext        *self,                       const char             *method_name,                       GVariant               *parameters,                       GDBusMethodInvocation  *invocation,                       const Action           *actions,                       int                     n_actions) {   ....   int idx = -1;    g_variant_get (parameters, &quot;(i)&quot;, &amp;idx);    const Action *action = &amp;actions[idx];    if (idx &gt;= 0 &amp;&amp; idx &lt; n_actions)     g_dbus_method_invocation_return_value (       invocation, g_variant_new (&quot;(s)&quot;, action-&gt;name));   else     g_dbus_method_invocation_return_error (invocation,                                            G_IO_ERROR,                                            G_IO_ERROR_INVALID_ARGUMENT,                                            &quot;Unknown action %d&quot;,                                            idx);   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V781 [CWE-129] The value of the &#8216;idx&#8217; variable is checked after it was used. Perhaps there is a mistake in program logic. Check lines: 71, 73. gtkatspiaction.c 71<\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>idx<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">const Action *action = &amp;actions[idx];<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u043d\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (idx &gt;= 0 &amp;&amp; idx &lt; n_actions)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u0437\u0434\u043d\u043e, \u0438 \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f: V781 [CWE-129] The value of the &#8216;idx&#8217; variable is checked after it was used. Perhaps there is a mistake in program logic. Check lines: 132, 134. gtkatspiaction.c 132<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N17, N18. \u041d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0439 \u043a\u043e\u0434<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static gboolean parse_n_plus_b (GtkCssParser *parser,                 int           before,                 int          *a,                 int          *b) {   const GtkCssToken *token;    token = gtk_css_parser_get_token (parser);    if (gtk_css_token_is_ident (token, &quot;n&quot;))     {       ....       return parse_plus_b (parser, FALSE, b);     }   else if (gtk_css_token_is_ident (token, &quot;n-&quot;))     {       ....       return parse_plus_b (parser, TRUE, b);     }   else if (gtk_css_token_is (token, GTK_CSS_TOKEN_IDENT) &amp;&amp;            string_has_number (token-&gt;string.string, &quot;n-&quot;, b))     {       ....       return TRUE;     }   else     {       *b = before;       *a = 0;       return TRUE;     }    gtk_css_parser_error_syntax (parser, &quot;Not a valid an+b type&quot;);   return FALSE; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V779 [CWE-561] Unreachable code detected. It is possible that an error is present. gtkcssselector.c 1077<\/p>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0438\u0434\u0430 if-else-if-else\u2026 \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0435\u043b\u043e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0445\u043e\u0434\u043e\u043c \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0418 \u044d\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435. <\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0441\u0445\u043e\u0436\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u043c \u043a\u043e\u0434\u043e\u043c: V779 [CWE-561] Unreachable code detected. It is possible that an error is present. gtktreemodelfilter.c 3289<\/p>\n<p>  <\/p>\n<h3 id=\"raznoe\">\u0420\u0430\u0437\u043d\u043e\u0435<\/h3>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N19, N20. \u0426\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void gtk_paint_spinner (GtkStyleContext *context,                    cairo_t         *cr,                    guint            step,                    int              x,                    int              y,                    int              width,                    int              height) {   GdkRGBA color;   guint num_steps;   double dx, dy;   ....   dx = width \/ 2;   dy = height \/ 2;   ....   cairo_move_to (cr,                  dx + (radius - inset) * cos (i * G_PI \/ half),                  dy + (radius - inset) * sin (i * G_PI \/ half));   cairo_line_to (cr,                  dx + radius * cos (i * G_PI \/ half),                  dy + radius * sin (i * G_PI \/ half));   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p>  <\/p>\n<ul>\n<li>V636 [CWE-682] The &#8216;width \/ 2&#8217; expression was implicitly cast from &#8216;int&#8217; type to &#8216;double&#8217; type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) \/ Y;. gtkcellrendererspinner.c 412<\/li>\n<li>V636 [CWE-682] The &#8216;height \/ 2&#8217; expression was implicitly cast from &#8216;int&#8217; type to &#8216;double&#8217; type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) \/ Y;. gtkcellrendererspinner.c 413<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <em>dx<\/em> \u0438 <em>dy<\/em>. \u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f <em>double<\/em>. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u043f\u043b\u043e\u0448\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">dx = width \/ 2.0; dy = height \/ 2.0;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u044d\u0442\u0438 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>V636 [CWE-682] The &#8216;width \/ 2&#8217; expression was implicitly cast from &#8216;int&#8217; type to &#8216;double&#8217; type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) \/ Y;. gtkswitch.c 255<\/li>\n<li>V636 [CWE-682] The &#8216;width \/ 2&#8217; expression was implicitly cast from &#8216;int&#8217; type to &#8216;double&#8217; type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) \/ Y;. gtkswitch.c 257<\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N21. \u041f\u0430\u0440\u043e\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0437\u0430\u0442\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438<\/strong><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0430\u0442\u044c\u0438, \u044f \u043f\u0440\u0438\u0431\u0435\u0440\u0451\u0433 \u0432\u0435\u0441\u044c\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>memset<\/em> \u0434\u043b\u044f \u0437\u0430\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u0446\u0435\u043b\u044f\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043b\u044e\u0431\u044f\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u0430\u043a \u043a\u0430\u043a, \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 C \u0438 C++, \u0435\u0441\u043b\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0451 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0435\u0441\u043b\u0438 \u0434\u0430\u043b\u0435\u0435 \u0438\u0437 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u042f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437, \u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f \u0441 \u0435\u0451 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u044d\u0442\u0438\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u043c, \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0430\u043c:<\/p>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/14.html\">CWE-14: Compiler Removal of Code to Clear Buffers<\/a><\/li>\n<li><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><\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 GTK 4? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>free<\/em> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u0437\u0434\u0435\u0441\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430\u0447\u043d\u0451\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043b\u0438 \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 GTK 4 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>g_free<\/em>. \u041e\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \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\">void g_free (gpointer mem) {   free (mem);   TRACE(GLIB_MEM_FREE((void*) mem)); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0435\u0433\u0434\u0430 \u043b\u0438 <em>g_free<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439 \u043d\u0430\u0434 <em>free<\/em>? \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 GLib 2.46 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a. \u0412\u043e\u0442 \u0447\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<blockquote><p>It&#8217;s important to match g_malloc() (and wrappers such as g_new()) with g_free(), g_slice_alloc() (and wrappers such as g_slice_new()) with g_slice_free(), plain malloc() with free(), and (if you&#8217;re using C++) new with delete and new[] with delete[]. Otherwise bad things can happen, since these allocators may use different memory pools (and new\/delete call constructors and destructors).<\/p>\n<p>  <strong>Since GLib 2.46 g_malloc() is hardcoded to always use the system malloc implementation.<\/strong><\/p><\/blockquote>\n<p>\u0418\u0442\u0430\u043a, \u0440\u0430\u0437 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 <em>g_malloc<\/em> \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em>malloc<\/em>, \u0442\u043e \u0434\u043b\u044f \u0435\u0451 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>free<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void overwrite_and_free (gpointer data) {   char *password = (char *) data;    if (password != NULL)     {       memset (password, 0, strlen (password));       g_free (password);     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V597 [CWE-14] The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;password&#8217; object. The memset_s() function should be used to erase the private data. gtkprintbackendcups.c 848<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0443\u043b\u044f\u043c\u0438, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u0442\u0443 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <em>g_free<\/em>. \u0418 \u0437\u0434\u0435\u0441\u044c, \u043a\u0430\u043a \u043d\u0438\u043a\u043e\u0433\u0434\u0430, \u043f\u0440\u043e\u044f\u0432\u0438\u0442 \u0441\u0435\u0431\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0435\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>g_free<\/em> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <em>overwrite_and_free<\/em>, \u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>memset<\/em> \u043b\u0438\u0448\u043d\u044f\u044f \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0435\u0451.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u0437 \u0441\u0444\u0435\u0440\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/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\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0441\u0432\u043e\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 IntelliJ IDEA, Rider, IncrediBuild, Jenkins, PlatformIO, Travis CI, GitLab CI\/CD, CircleCI, TeamCity, Visual Studio \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0435\u0433\u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439. \u041c\u044b, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0434\u0430\u0436\u0435 \u043d\u0435 \u0440\u0430\u0434\u044b, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u0433\u043e. \u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0443\u044e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u043a\u0430\u043a \u044d\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u044b\u043b\u043e 10 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u043a\u043e\u0433\u0434\u0430 PVS-Studio \u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Visual Studio. \u0410 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u0435\u0442 :). \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043d\u0430 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0433\u0440\u0430\u0431\u043b\u0438, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u0438 \u0437\u0430\u0434\u0430\u044e\u0442 \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u0445\u043e\u0436\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0430\u0441\u0442\u043e \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430-\u0442\u043e \u0438 \u043d\u0435\u0442 :). \u0410 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 SonarQube.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u0443\u043c\u0430\u043b\u0438 \u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0432\u0438\u0434\u0435\u043e\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f PVS-Studio. \u0422\u0430\u043a \u0438\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u0447\u0435 \u043d\u0430\u0439\u0442\u0438, \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043a \u0447\u0435\u043c\u0443. \u0418 \u0447\u0442\u043e \u0435\u0449\u0451 \u0432\u0430\u0436\u043d\u0435\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0430\u043d\u0430\u043b \u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u043e\u0432\u0448\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u043d\u0430\u0448\u0438 \u043d\u043e\u0432\u044b\u0435 \u0432\u0438\u0434\u0435\u043e\u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u041b\u0443\u0447\u0448\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 PVS-Studio \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e, \u0430 \u043d\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u0438\u043b\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e :). \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435\u0442 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c! \u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f: <a href=\"https:\/\/www.youtube.com\/playlist?list=PLmGioT8z4uoZsce6HQTIDFar_2hdbqPD7\">\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 PVS-Studio (YouTube)<\/a>.<\/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\/540650\/\">Finding Typos in the GTK 4 Project by PVS-Studio<\/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\/540654\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/540654\/<\/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\/webt\/lw\/ze\/zm\/lwzezm314gglzxufoodz9sapfji.png\" alt=\"0793_GTK_4_continue_ru\/image1.png\"><\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u043d\u0435\u0434\u0430\u0432\u043d\u044e\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 PVS-Studio \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 GTK 4 \u0438 \u043e \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043e\u0442\u0447\u0451\u0442\u043e\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e. \u0418 \u043a\u0430\u043a \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u0448\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435 \u043e\u0448\u0438\u0431\u043e\u043a.<\/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-317390","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317390","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=317390"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317390\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}