{"id":403351,"date":"2024-06-29T17:04:26","date_gmt":"2024-06-29T17:04:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=403351"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=403351","title":{"rendered":"<span>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 BitTorrent \u0432 \u0447\u0435\u0441\u0442\u044c 20-\u043b\u0435\u0442\u043d\u0435\u0433\u043e \u044e\u0431\u0438\u043b\u0435\u044f. \u0412\u0440\u0435\u043c\u044f == \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0430\u0440\u0443 \u043d\u0435\u0434\u0435\u043b\u044c \u043d\u0430\u0437\u0430\u0434 (\u0430 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435, \u0442\u043e 2 \u0438\u044e\u043b\u044f 2021 \u0433\u043e\u0434\u0430) \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u043b\u043e\u0441\u044c \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044c \u043b\u0435\u0442 \u043b\u0435\u0433\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 BitTorrent. \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0411\u0440\u044d\u043c\u043e\u043c \u041a\u043e\u0443\u044d\u043d\u043e\u043c (Bram Cohen) \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043b \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0432 \u0447\u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u0434\u043e\u043b\u0433\u043e\u0436\u0438\u0432\u0443\u0449\u0438\u0445 \u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u0434\u043b\u044f Linux?<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/import.viva64.com\/docx\/blog\/0846_BitTorrent_ru\/image1.png\" alt=\"0846_BitTorrent_ru\/image1.png\" data-src=\"https:\/\/import.viva64.com\/docx\/blog\/0846_BitTorrent_ru\/image1.png\"\/><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"vvedenie\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043d\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: libtorrent (\u043e\u043d \u0436\u0435 &#171;Rasterbar libtorrent&#187; \u0438\u043b\u0438 &#171;rb-libtorrent&#187;) \u0438 Transmission.<\/p>\n<p>  <\/p>\n<p>Libtorrent \u2013 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c BitTorrent, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++. \u041d\u0430 <a href=\"https:\/\/libtorrent.org\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a> \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0443\u0434\u044f \u043f\u043e \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0439 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comparison_of_BitTorrent_clients\">wiki<\/a>, \u043d\u0430 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043a\u043e\u043b\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u0435\u0439\u0447\u0430\u0441 BitTorrent \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>Transmission \u2013 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 BitTorrent \u043a\u043b\u0438\u0435\u043d\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c <a href=\"https:\/\/github.com\/transmission\/transmission\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c<\/a>. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0443 libtorrent, \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 Transmission \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0440\u0435\u043a\u043b\u0430\u043c\u044b, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, \u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439, \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e GUI (\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430) \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 headless \u0432\u0435\u0440\u0441\u0438\u0439 (\u0431\u0435\u0437 GUI) \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0440\u043e\u0443\u0442\u0435\u0440\u0430\u0445 \u0438 \u0442. \u043f.<\/p>\n<p>  <\/p>\n<h2 id=\"kak-proveryalos\">\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u043e\u0441\u044c<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c Linux \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u0430\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0441 Ubuntu 20.04 \u0447\u0435\u0440\u0435\u0437 WSL2. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/manual\/0036\/\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>):<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">wget -q -O - https:\/\/files.viva64.com\/etc\/pubkey.txt | \\   sudo apt-key add -  sudo wget -O \/etc\/apt\/sources.list.d\/viva64.list \\   https:\/\/files.viva64.com\/etc\/viva64.list  sudo apt-get update sudo apt-get install pvs-studio<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0432\u043e\u0435\u0439 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">pvs-studio-analyzer credentials NAME KEY<\/code><\/pre>\n<p>  <\/p>\n<p>(\u0433\u0434\u0435 NAME \u0438 KEY \u2013 \u0438\u043c\u044f \u0438 \u043a\u043b\u044e\u0447 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e).<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 ~\/.config\/PVS-Studio\/, \u0438 \u0435\u0451 \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443, \u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f\u0445\u2026 \u041c\u044b \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0431\u0430\u0433\u0430\u0445 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u043d\u043e \u0438 \u0434\u0430\u0451\u043c \u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/0614\/\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c PVS-Studio \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e<\/a>. \u0412\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c <a href=\"https:\/\/pvs-studio.com\/ru\/pvs-studio\/download\/\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/a> \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0432 \u0434\u0435\u043b\u0435, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u2013 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043c \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b compile_commands.json (\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430). \u0410 \u0443\u0436\u0435 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432 PVS-Studio. \u0421 \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 -DCMAKE_EXPORT_COMPILE_COMMANDS=On \u043a \u0432\u044b\u0437\u043e\u0432\u0443 cmake. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=On ..<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043f\u0430\u043f\u043a\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b compile_commands.json, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">pvs-studio-analyzer analyze -o transmission.log -j 8<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0430 -o \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u0430 \u0444\u043b\u0430\u0433 <em>-j<\/em> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 PVS-Studio \u0432\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/manual\/0036\/\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2013 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 SARIF \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043e\u0442\u0447\u0451\u0442\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430. \u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 Visual Studio Code, \u0432\u0435\u0434\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=MS-SarifVSCode.sarif-viewer\">Sarif Viewer<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0451\u0442 \u0438 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u043c \u0432 \u043a\u043e\u0434\u0435 \u043c\u0435\u0441\u0442\u0430\u043c. \u041d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043d\u0438\u0436\u0435 \u0432\u044b \u043a\u0430\u043a \u0440\u0430\u0437 \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Transmission.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/import.viva64.com\/docx\/blog\/0846_BitTorrent_ru\/image3.png\" alt=\"0846_BitTorrent_ru\/image3.png\" data-src=\"https:\/\/import.viva64.com\/docx\/blog\/0846_BitTorrent_ru\/image3.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 SARIF \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 PVS-Studio \u0432 Linux \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">plog-converter -t sarif -o .\/transmission.sarif .\/transmission.log -d V1042<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e -t sarif \u043c\u044b \u043a\u0430\u043a \u0440\u0430\u0437 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 SARIF. \u0424\u043b\u0430\u0433 -o \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430-\u043e\u0442\u0447\u0451\u0442\u0430. \u0410 \u0444\u043b\u0430\u0433\u043e\u043c -d \u043c\u044b \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043e\u0431\u043c\u0435\u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (SARIF) \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.oasis-open.org\/committees\/tc_home.php?wg_abbrev=sarif\">OASIS Open<\/a>. \u0410 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 GitHub \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0798\/\">\u041a\u0430\u043a \u0432 GitHub \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u043e\u0442\u0447\u0435\u0442\u044b \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SARIF<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"rezultaty-proverki\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h2>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0445\u0432\u0430\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2013 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0438\u0441\u0442\u044b\u0439 \u0438 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445, \u043d\u043e\u2026 \u0443\u0432\u044b. \u041f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u043e \u043e\u0431\u044a\u0435\u043c\u0443, \u0438 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0438\u043c\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 changelog&#8217;\u0430\u0445 \u0431\u044b\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/terms\/0074\/\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432<\/a> (Coverity, Cppcheck). \u041d\u043e \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0432\u0441\u0451 \u044d\u0442\u043e PVS-Studio \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0430\u0440\u0443 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  <\/p>\n<h3 id=\"transmission\">Transmission<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Transmission, \u043a\u0430\u043a \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0438 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e. \u0422\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0447\u0443 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c\u0441\u044f. <\/p>\n<p>  <\/p>\n<h4 id=\"fragment-n1-ispolzovanie-memset-dlya-ochistki-pamyati\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 memset \u0434\u043b\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438<\/h4>\n<p>  <\/p>\n<pre><code class=\"cpp\">static void freeMetaUI(gpointer p) {   MakeMetaUI* ui = p;    tr_metaInfoBuilderFree(ui->builder);   g_free(ui->target);   memset(ui, ~0, sizeof(MakeMetaUI));   g_free(ui); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v597\/\">V597<\/a> The compiler could delete the &#8216;memset&#8217; function call, which is used to flush &#8216;ui&#8217; object. The memset_s() function should be used to erase the private data. makemeta-ui.c:53<\/p>\n<p>  <\/p>\n<p>\u0423\u0436\u0435 \u043d\u0435\u043c\u0430\u043b\u043e \u0440\u0430\u0437 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0434\u0430 \u0438 \u043d\u0435\u043c\u0430\u043b\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u0440\u043e \u0433\u0440\u0430\u0431\u043b\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 memset \u0434\u043b\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b memset, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0445 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 (\u0442\u0430\u043a\u043e\u0435 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0444\u0435\u0440 \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f). \u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0443\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/godbolt.org\/z\/9ojhPYa68\">\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/a> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c Compiler Explorer.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/import.viva64.com\/docx\/blog\/0846_BitTorrent_ru\/image5.png\" alt=\"0846_BitTorrent_ru\/image5.png\" data-src=\"https:\/\/import.viva64.com\/docx\/blog\/0846_BitTorrent_ru\/image5.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0440\u0438\u0441\u0443\u043d\u043a\u0430 \u0432\u044b\u0448\u0435, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Clang 12.0.1 \u0443\u0436\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u043b\u0430\u0433\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 -O2 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 memset. \u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u043a\u0430\u0436\u0443\u0442: &#171;\u041d\u0443, \u0443\u0434\u0430\u043b\u0438\u043b \u0438 \u0443\u0434\u0430\u043b\u0438\u043b, \u0447\u0435\u0433\u043e \u0431\u0443\u0431\u043d\u0438\u0442\u044c-\u0442\u043e&#187;, \u2014 \u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0435\u0437\u0430\u0442\u0451\u0440\u0442\u044b\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0421\u043e\u0433\u043b\u0430\u0441\u0435\u043d, \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0440\u0440\u0435\u043d\u0442\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u041d\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0442\u0430\u043a \u0437\u0434\u0435\u0441\u044c, \u0442\u043e \u0447\u0442\u043e \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442 \u0435\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a \u0436\u0435 \u0432 \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435? \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/en.cppreference.com\/w\/c\/string\/byte\/memset\">memset_s<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-hardware\/drivers\/ddi\/wdm\/nf-wdm-rtlsecurezeromemory?redirectedfrom=MSDN\">RtlSecureZeroMemory<\/a>). \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u043c\u043e\u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0438 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0360\/\">\u0440\u0430\u0437<\/a>, <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/k0041\/\">\u0434\u0432\u0430<\/a> \u0438 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0388\/\">\u0442\u0440\u0438<\/a>.<\/p>\n<p>  <\/p>\n<h4 id=\"fragment-n2-oshibki-v-bibliotekah--tozhe-oshibki\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2: \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u2013 \u0442\u043e\u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h4>\n<p>  <\/p>\n<pre><code class=\"cpp\">void jsonsl_jpr_match_state_init(jsonsl_t jsn,                                  jsonsl_jpr_t *jprs,                                  size_t njprs) {   size_t ii, *firstjmp;   ...   jsn->jprs = (jsonsl_jpr_t *)malloc(sizeof(jsonsl_jpr_t) * njprs);   jsn->jpr_count = njprs;   jsn->jpr_root = (size_t*)calloc(1, sizeof(size_t) * njprs * jsn->levels_max);   memcpy(jsn->jprs, jprs, sizeof(jsonsl_jpr_t) * njprs);    \/* Set the initial jump table values *\/   firstjmp = jsn->jpr_root;   for (ii = 0; ii &lt; njprs; ii++) {     firstjmp[ii] = ii+1;   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v575\/\">V575<\/a> The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 1142, 1139. jsonsl.c:1142<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v522\/\">V522<\/a> There might be dereferencing of a potential null pointer &#8216;firstjmp&#8217;. Check lines: 1147, 1141. jsonsl.c:1147<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0441\u043a\u0440\u044b\u043b\u0438\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0438 \u043e\u0431\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 malloc\/calloc. \u0414\u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u043e\u044f\u0432\u0438\u0442 \u0441\u0435\u0431\u044f, \u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041f\u043e\u0447\u0435\u043c\u0443? \u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2013 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0431\u0435\u0437\u043e\u0433\u043e\u0432\u043e\u0440\u043e\u0447\u043d\u043e \u0434\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0438\u043c \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u0418, \u044f \u0434\u0443\u043c\u0430\u044e, \u043c\u0430\u043b\u043e \u043a\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u0432\u0440\u0435\u0434\u0438\u0442 \u0432\u0430\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e \u0432\u0438\u043d\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0438 \u043f\u0443\u0442\u0438 \u0435\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 &#171;<a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/348098\/\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f malloc<\/a>&#187; \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043a \u043d\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u044f\u0432\u0438\u043b \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;jsn&#8217;. Check lines: 117, 113. jsonsl.c:117<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;i&#8217;. DetailsDialog.cc:133<\/li>\n<li>V522 There might be dereferencing of a potential null pointer. TorrentFilter.cc:320<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"libtorrent\">libtorrent<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u0441 Transmission \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 libtorrent.<\/p>\n<p>  <\/p>\n<h4 id=\"fragment-n1-nedostatochnaya-proverka-indeksov-massivov\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1: \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432<\/h4>\n<p>  <\/p>\n<pre><code class=\"cpp\">template &lt;typename Handler> void handshake2(error_code const&amp; e, Handler h) {   ...   std::size_t const read_pos = m_buffer.size();   ...   if (m_buffer[read_pos - 1] == '\\n' &amp;&amp; read_pos > 2) \/\/ &lt;=   {     if (m_buffer[read_pos - 2] == '\\n')     {       found_end = true;     }     else if (read_pos > 4       &amp;&amp; m_buffer[read_pos - 2] == '\\r'       &amp;&amp; m_buffer[read_pos - 3] == '\\n'       &amp;&amp; m_buffer[read_pos - 4] == '\\r')     {       found_end = true;     }   }   ... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v781\/\">V781<\/a> The value of the &#8216;read_pos&#8217; index is checked after it was used. Perhaps there is a mistake in program logic. http_stream.hpp:166.<\/p>\n<p>  <\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 m_buffer \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 read_pos \u2014 1, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c read_pos \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c (read_pos > 2). \u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u0430 \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u0430 \u043c\u043e\u0436\u0435\u0442, \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 Access Violation. \u0412\u0441\u0451-\u0442\u0430\u043a\u0438 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 (Undefined Behavior) \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \ud83d\ude42 \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">if (read_pos > 2 &amp;&amp; m_buffer[read_pos - 1] == '\\n')<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"fragment-n2-n3-perezapisyvanie-znacheniy\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2, N3: \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/h4>\n<p>  <\/p>\n<pre><code class=\"cpp\">void dht_tracker::dht_status(session_status&amp; s) {   s.dht_torrents += int(m_storage.num_torrents());    \/\/ &lt;=    s.dht_nodes = 0;   s.dht_node_cache = 0;   s.dht_global_nodes = 0;   s.dht_torrents = 0;                                 \/\/ &lt;=   s.active_requests.clear();   s.dht_total_allocations = 0;    for (auto&amp; n : m_nodes)     n.second.dht.status(s); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v519\/\">V519<\/a> The &#8216;s.dht_torrents&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 205, 210. dht_tracker.cpp 210.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f s.dht_torrents: \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0435\u0439 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u043e\u043d\u043e \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f\u043c\u0438. \u0422. \u0435. \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0442\u0443\u043f\u0438\u043a\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e (Dead Store). \u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u043e\u0434, \u0442. \u043a. \u0442\u0438\u043f session_status \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0439. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0439 \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u043d\u0435\u0435 \u0438\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0435\u0441\u0442\u044c \u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043a\u043e\u0434\u0430, \u043d\u043e \u0442\u0430\u043c \u043e\u043d\u0430 \u0443\u0441\u0443\u0433\u0443\u0431\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430 \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u0410 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0434\u0435\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u0442\u0440\u0438, \u043f\u0440\u0438\u0447\u0451\u043c \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0438 \u0434\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u041e\u0442\u043b\u043e\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e, \u0430 \u0432\u043e\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u043d\u0430 \u0440\u0430\u0437:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void torrent::bytes_done(torrent_status&amp; st, status_flags_t const flags) const {   ...   st.total_done = 0;   st.total_wanted_done = 0;   st.total_wanted = m_size_on_disk;   ...   if (m_seed_mode || is_seed())   {     st.total_done = m_torrent_file->total_size() - m_padding_bytes;     st.total_wanted_done = m_size_on_disk;     st.total_wanted = m_size_on_disk;     ...     return;   }   else if (!has_picker())   {     st.total_done = 0;     st.total_wanted_done = 0;     st.total_wanted = m_size_on_disk;     return;   }   ... }<\/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>V1048 The &#8216;st.total_wanted&#8217; variable was assigned the same value. torrent.cpp 3784<\/li>\n<li>V1048 The &#8216;st.total_done&#8217; variable was assigned the same value. torrent.cpp 3792<\/li>\n<li>V1048 The &#8216;st.total_wanted_done&#8217; variable was assigned the same value. torrent.cpp 3793<\/li>\n<li>V1048 The &#8216;st.total_wanted&#8217; variable was assigned the same value. torrent.cpp 3794<\/li>\n<\/ul>\n<p>  <\/p>\n<h4 id=\"fragment-n4-neudachnoe-yavnoe-privedenie-tipa\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4: \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u044f\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430<\/h4>\n<p>  <\/p>\n<pre><code class=\"cpp\">void torrent::get_download_queue(std::vector&lt;partial_piece_info>* queue) const {   ...   const int blocks_per_piece = m_picker->blocks_in_piece(piece_index_t(0));   ...   int counter = 0;   for (auto i = q.begin(); i != q.end(); ++i, ++counter)   {     partial_piece_info pi;     ...     pi.blocks = &amp;blk[std::size_t(counter * blocks_per_piece)];   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v1028\/\">V1028<\/a> Possible overflow. Consider casting operands of the &#8216;counter * blocks_per_piece&#8217; operator to the &#8216;size_t&#8217; type, not the result. torrent.cpp 7092<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043a <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/terms\/0044\/\">size_t<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0434\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0431\u0430 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0438 \u043f\u0440\u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. \u041e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e-\u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0433\u043b\u0443\u0448\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043b\u043e\u0434\u044f\u0442 \u043e\u0448\u0438\u0431\u043a\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043a \u0442\u0438\u043f\u0443 size_t. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">pi.blocks = &amp;blk[std::size_t(counter) * blocks_per_piece];<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0431\u044b\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li>V1028 Possible overflow. Consider casting operands of the &#8216;new_size_words + 1&#8217; operator to the &#8216;size_t&#8217; type, not the result. bitfield.cpp 179<\/li>\n<li>V1028 Possible overflow. Consider casting operands of the &#8216;m_capacity + amount_to_grow&#8217; operator to the &#8216;size_t&#8217; type, not the result. heterogeneous_queue.hpp 207<\/li>\n<\/ul>\n<p>  <\/p>\n<h4 id=\"fragment-n5-lishnie-usloviya\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5: \u043b\u0438\u0448\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/h4>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 libtorrent \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 Transmission, \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u0430\u043b\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438. \u041b\u043e\u0436\u043d\u044b\u043c\u0438 \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u043d\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0438\u0445 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0430\u043b\u043e. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u044f \u0438\u043c\u0435\u044e \u0432 \u0432\u0438\u0434\u0443, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">char const* operation_name(operation_t const op)   {     ...     static char const* const names[] = {       ...     };      int const idx = static_cast&lt;int>(op);     if (idx &lt; 0 || idx >= int(sizeof(names) \/ sizeof(names[0])))       return \"unknown operation\";     return names[idx]; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v560\/\">V560<\/a> A part of conditional expression is always false: idx &lt; 0. alert.cpp 1885.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0451\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 idx &lt; 0 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u0442. \u043a. \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f index \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043b\u0438\u0448\u044c \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430: <\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">enum class operation_t : std::uint8_t<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f? \u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0430\u0439\u0434\u0451\u0442\u0441\u044f \u0441\u0432\u043e\u0451 \u043c\u043d\u0435\u043d\u0438\u0435. \u041a\u0442\u043e-\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u043d\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0430 \u043a\u0442\u043e-\u0442\u043e, \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u0441\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c \u043a\u043e\u0434. \u042f \u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u2013 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043c\u043d\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0435\u0449\u0435 \u0440\u0430\u0437 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438 \u0447\u0438\u0441\u0442\u043e\u0442\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0414\u0443\u043c\u0430\u044e, \u043d\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0440\u043e\u043b\u044c \u0437\u0434\u0435\u0441\u044c \u0438\u0433\u0440\u0430\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0443\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e, \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f open source \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0438, \u0441\u0443\u0434\u044f \u043f\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432, \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438\u0441\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0435\u0449\u0435 \u0440\u0430\u0437 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 PVS-Studio \u043b\u044e\u0431\u0438\u0442 \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0431\u0430\u0433\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043d\u043e \u0438 \u0434\u0430\u0451\u043c \u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"https:\/\/pvs-studio.com\/ru\/order\/open-source-license\/\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c PVS-Studio \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e<\/a>. \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043b\u0438\u0448\u043d\u0438\u043c \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e <a href=\"https:\/\/pvs-studio.com\/ru\/order\/for-students\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 \u0434\u043b\u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u0438 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/a>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c <a href=\"https:\/\/pvs-studio.com\/ru\/pvs-studio\/download\/\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/a> \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio, \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0432 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0435 \ud83d\ude42<\/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: Mikhail Gelvikh. <a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/570446\/\">Checking BitTorrent in honor of the 20th anniversary. Time == quality<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/570448\/\"> https:\/\/habr.com\/ru\/articles\/570448\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0430\u0440\u0443 \u043d\u0435\u0434\u0435\u043b\u044c \u043d\u0430\u0437\u0430\u0434 (\u0430 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435, \u0442\u043e 2 \u0438\u044e\u043b\u044f 2021 \u0433\u043e\u0434\u0430) \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u043b\u043e\u0441\u044c \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044c \u043b\u0435\u0442 \u043b\u0435\u0433\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 BitTorrent. \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0411\u0440\u044d\u043c\u043e\u043c \u041a\u043e\u0443\u044d\u043d\u043e\u043c (Bram Cohen) \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043b \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0432 \u0447\u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u0434\u043e\u043b\u0433\u043e\u0436\u0438\u0432\u0443\u0449\u0438\u0445 \u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u0434\u043b\u044f Linux?<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/import.viva64.com\/docx\/blog\/0846_BitTorrent_ru\/image1.png\" alt=\"0846_BitTorrent_ru\/image1.png\" data-src=\"https:\/\/import.viva64.com\/docx\/blog\/0846_BitTorrent_ru\/image1.png\"\/><\/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-403351","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/403351","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=403351"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/403351\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=403351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=403351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=403351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}