{"id":458917,"date":"2025-05-07T15:00:55","date_gmt":"2025-05-07T15:00:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=458917"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=458917","title":{"rendered":"<span>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u043b\u044f \u0420\u0411\u041f\u041e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 190 \u0431\u0430\u0433\u043e\u0432 \u0432 TDengine<\/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><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ko\/ki\/au\/kokiaukueeqlsppeutf4kqg4t30.png\" alt=\"\u0420\u0411\u041f\u041e\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/ko\/ki\/au\/kokiaukueeqlsppeutf4kqg4t30.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/ko\/ki\/au\/kokiaukueeqlsppeutf4kqg4t30.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0430\u0436\u043d\u0435\u0439\u0448\u0438\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 \u0440\u0430\u043d\u043d\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e, \u0447\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0445 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041d\u043e \u0447\u0442\u043e \u0435\u0449\u0451 \u0432\u0430\u0436\u043d\u0435\u0435, \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u0442\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u0434\u0435\u0444\u0435\u043a\u0442\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0442.<\/p>\n<p><a name=\"habracut\"><\/a> <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f (\u0420\u0411\u041f\u041e) \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430 \u0432 \u0434\u0432\u0443\u0445 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044f\u0445. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 &#171;\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f&#187; (\u043a\u0430\u043a \u0441\u0442\u0430\u0440\u044b\u0439 \u0413\u041e\u0421\u0422 \u0420 56939-2016, \u0442\u0430\u043a \u0438 \u043d\u043e\u0432\u044b\u0439 \u0413\u041e\u0421\u0422 \u0420 56939-2024) \u044f\u0432\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u043d\u0435 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c &#171;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438&#187;, \u0430, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0435\u0435, \u043d\u0430\u0434\u0451\u0436\u043d\u0435\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435.<\/p>\n<p> <\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0441\u043b\u0443\u0447\u0430\u0435\u043c, \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u043e\u0439 \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043a\u0430\u043d\u0430\u043b &#171;<a href=\"https:\/\/t.me\/programming_tales\">\u0411\u0435\u0441\u0442\u0438\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a>&#171;, \u0433\u0434\u0435 \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0446\u0438\u043a\u043b \u043f\u043e\u0441\u0442\u043e\u0432, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u044b\u0445 \u0420\u0411\u041f\u041e.<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/taosdata\/TDengine\">TDengine<\/a>, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0442\u0440\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u043f\u0440\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043a\u043e\u0434\u0430:<\/p>\n<p> <\/p>\n<ol>\n<li>\u0423\u0447\u0438\u043c\u0441\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0430\u0433\u043e\u0432 \u0432 TDengine, \u0447\u0430\u0441\u0442\u044c 1: <a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/888060\/\">\u043f\u0440\u043e \u043a\u043e\u043b\u0431\u0430\u0441\u0443<\/a>.<\/li>\n<li>\u0423\u0447\u0438\u043c\u0441\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0430\u0433\u043e\u0432 \u0432 TDengine, \u0447\u0430\u0441\u0442\u044c 2: <a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/891850\/\">\u043c\u0430\u043a\u0440\u043e\u0441, \u043f\u043e\u0436\u0438\u0440\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0435\u043a<\/a>.<\/li>\n<li>\u0423\u0447\u0438\u043c\u0441\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0430\u0433\u043e\u0432 \u0432 TDengine, \u0447\u0430\u0441\u0442\u044c 3: <a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/895978\/\">\u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u043b\u0435\u043d\u044c<\/a>.<\/li>\n<\/ol>\n<p> <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 TDengine \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f IoT \u0441\u0438\u0441\u0442\u0435\u043c, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043a \u043d\u0435\u0439 \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u043b\u0430\u043d\u0435 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio, \u0432\u044b\u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u043d\u043e \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p> <\/p>\n<blockquote><p>TDengine is an open source, high-performance, cloud native time-series database optimized for Internet of Things (IoT), Connected Cars, and Industrial IoT. It enables efficient, real-time data ingestion, processing, and monitoring of TB and even PB scale data per day, generated by billions of sensors and data collectors.<\/p><\/blockquote>\n<p>\u041e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e \u0432\u044b\u0445\u043e\u0434\u0430 \u044d\u0442\u043e\u0439 (\u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0439) \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e\u0448\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430 \u0441\u0435\u0439\u0447\u0430\u0441, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0436\u0435 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u042f \u043f\u0438\u0448\u0443 \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0430 \u043d\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0440\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio, \u043d\u043e \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u0441 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e. <a href=\"https:\/\/habr.com\/ru\/articles\/436868\/\">\u0412\u043d\u0435\u0434\u0440\u044f\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0430 \u043d\u0435 \u0438\u0449\u0438\u0442\u0435 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0430\u0433\u0438<\/a>.<\/p>\n<p> <\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043e\u0442\u0434\u0435\u043b\u044f\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044e \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043f\u0440\u043e\u0435\u043a\u0442 TDengine. \u042f \u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438 \u043d\u0430\u0434 \u0442\u0430\u043a\u0438\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c:<\/p>\n<p> <\/p>\n<blockquote><p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c: \u0432 \u043a\u043e\u0434\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u0432\u0430\u043c\u0438, \u0438\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043a\u043e\u0434, \u0442\u043e \u043d\u0435\u0441\u0451\u0442\u0435 \u0437\u0430 \u043d\u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c. \u041e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c \u043a\u043e\u0434\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0432\u0430\u0448\u0438\u043c\u0438.<\/p><\/blockquote>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u043e, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 third-party \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430:<\/p>\n<p> <\/p>\n<ol>\n<li>\u042d\u0442\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0762\/\">\u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c<\/a> \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f;<\/li>\n<li>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0431\u043b\u0430\u0433\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6478\/\">\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0434\u043d\u044f<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044e \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442. \u0412\u0440\u043e\u0434\u0435 \u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435 \u0432\u0430\u0448\u0430, \u043d\u043e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u0447\u0435;<\/li>\n<li>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445, \u0432\u044b \u0432\u043d\u0435\u0441\u0451\u0442\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0432\u043a\u043b\u0430\u0434 \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/li>\n<\/ol>\n<p> <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f (\u0420\u0411\u041f\u041e). \u0412 \u0413\u041e\u0421\u0422 \u0420 71207\u20142024 (\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f) \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0446\u0435\u043b\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f:<\/p>\n<p> <\/p>\n<blockquote><p>5.10.1.1 \u041f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u041f\u041e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 <strong>\u0438\u0437 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/strong>.<\/p><\/blockquote>\n<p>\u0412 \u0413\u041e\u0421\u0422 \u0420 71207\u2014 2024 (\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f) \u0442\u0430\u043a\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u043f\u0440\u043e \u0430\u043d\u0430\u043b\u0438\u0437 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<p> <\/p>\n<blockquote><p>5.4.\u2026 \u041f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\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 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, <strong>\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u041f\u041e \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/strong>, \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0432\u044b\u0434\u0430\u0447\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0438 \u043f\u0440.\u2026<\/p>\n<p> 8.2. <strong>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u041f\u041e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c\u0438 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u0446\u0435\u043b\u0438\u043a\u043e\u043c<\/strong>, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c 7.3\u20147.6, 8.3 \u0438 8.4.<\/p><\/blockquote>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong> \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/gost-71207\/\">PVS-Studio \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438, \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u0413\u041e\u0421\u0422 \u0420 71207\u20142024<\/a>, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.<\/p>\n<p> <\/p>\n<h2 id=\"130-ottenkov-nulevyh-ukazateley\">130 \u043e\u0442\u0442\u0435\u043d\u043a\u043e\u0432 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439<\/h2>\n<p> <\/p>\n<p>\u0413\u041e\u0421\u0422 \u0420 71207\u20142024 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0442\u0438\u043f\u044b <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6441\/\">\u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0434\u0435\u0444\u0435\u043a\u0442\u0430\u043c \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u041a \u043d\u0438\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0438 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 (\u043f 6.5.\u0430). \u042d\u0442\u043e \u043d\u0435\u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\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 (\u0442.\u0435. \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0438\u0445 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f).<\/p>\n<p> <\/p>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e\u043c\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6585\/\">DoS-\u0430\u0442\u0430\u043a\u0438 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/a>, \u0442.\u0435. \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u044e \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (\u043f\u0430\u0434\u0435\u043d\u0438\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u0430). \u0417\u0430\u043e\u0434\u043d\u043e \u0435\u0449\u0451 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0437\u0435 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p> <\/p>\n<p>\u0420\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u2014 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 TDengine \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p> <\/p>\n<h3 id=\"oshibka-n1-oshibka-vybora\">\u041e\u0448\u0438\u0431\u043a\u0430 N1. \u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u044b\u0431\u043e\u0440\u0430<\/h3>\n<p> <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>taosArrayGetLast<\/code> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c<code>NULL<\/code>:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">void* taosArrayGetLast(const SArray* pArray) {   if (pArray-&gt;size == 0) {     terrno = TSDB_CODE_INVALID_PARA;     return NULL;   }    return TARRAY_GET_ELEM(pArray, pArray-&gt;size - 1); }<\/code><\/pre>\n<p> <\/p>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0445\u043e\u0442\u0435\u043b \u044d\u0442\u043e \u0443\u0447\u0435\u0441\u0442\u044c, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">static int32_t walInitWriteFile(SWal *pWal) {   int64_t       fileFirstVer = -1;   ....   SWalFileInfo *pRet = taosArrayGetLast(pWal-&gt;fileInfoSet);   if (pRet == NULL) {     fileFirstVer = pWal-&gt;vers.lastVer + 1;   }   fileFirstVer = pRet-&gt;firstVer;   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <code>pRet<\/code>, \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435. \u0412\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>fileFirstVer<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0451\u0442 \u0437\u0434\u0435\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \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>V519 The &#8216;fileFirstVer&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 696, 698. walWrite.c 698<\/li>\n<li>V1004 The &#8216;pRet&#8217; pointer was used unsafely after it was verified against nullptr. Check lines: 695, 698. walWrite.c 698<\/li>\n<\/ul>\n<p> <\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0434\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>else<\/code>: <\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">SWalFileInfo *pRet = taosArrayGetLast(pWal-&gt;fileInfoSet); if (pRet == NULL) {   fileFirstVer = pWal-&gt;vers.lastVer + 1; } else {   fileFirstVer = pRet-&gt;firstVer; }<\/code><\/pre>\n<p> <\/p>\n<h3 id=\"oshibki-n2n6-oshibki-v-obrabotchikah-oshibok\">\u041e\u0448\u0438\u0431\u043a\u0438 N2\u2013N6. \u041e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u0445 \u043e\u0448\u0438\u0431\u043e\u043a<\/h3>\n<p> <\/p>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0430\u043c\u0438 \u0447\u0430\u0441\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439. \u042d\u0442\u043e \u043d\u0435\u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442. \u042e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u043d\u0438\u0445 \u0442\u043e\u0436\u0435 \u043d\u0435 \u043f\u0438\u0448\u0443\u0442. \u042d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0438 \u0441\u043a\u0443\u0447\u043d\u043e.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">int32_t ctgGetFetchName(SArray* pNames, SCtgFetch* pFetch, SName** ppName) {   STablesReq* pReq = (STablesReq*)taosArrayGet(pNames, pFetch-&gt;dbIdx);   if (NULL == pReq) {     qError(\"fail to get the %dth tb in pTables, tbNum:%d\",            pFetch-&gt;tbIdx, (int32_t)taosArrayGetSize(pReq-&gt;pTables));     return TSDB_CODE_CTG_INTERNAL_ERROR;   }   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> Dereferencing of the null pointer &#8216;pReq&#8217; might take place. ctgUtil.c 1769<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>pReq<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">STablesReq* pReq = ; if (NULL == pReq) {   ....(pReq-&gt;pTables));<\/code><\/pre>\n<p> <\/p>\n<p>\u0422\u0430\u043a \u0441\u0435\u0431\u0435 \u0438\u0434\u0435\u044f \ud83d\ude42<\/p>\n<p> <\/p>\n<p>\u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0440\u043e\u0434\u0435 \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0439: \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0435\u0451 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043a\u0440\u0430\u043d\u0435 \u0440\u0435\u0434\u043a\u0430\u044f, \u0438\u043d\u0430\u0447\u0435 \u0435\u0451 \u0431\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438.<\/p>\n<p> <\/p>\n<p>\u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043e\u043d\u0430 \u0441\u0442\u0440\u0430\u0448\u043d\u0430\u044f:<\/p>\n<p> <\/p>\n<ol>\n<li>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0431\u043e\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u0431\u0443\u0434\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u0435. \u0418, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0443\u0436\u0435 \u0436\u0430\u043b\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u044f, \u0432\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u0442\u043e\u0433\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u2026 \u0430 \u0435\u0433\u043e \u043d\u0435\u0442 \ud83d\ude42<\/li>\n<li>\u0420\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u2014 \u044d\u0442\u043e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u0441\u0451 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0412\u0435\u0434\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \ud83d\ude42<\/li>\n<\/ol>\n<p> <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0444\u0435\u043a\u0442\u044b \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u0445 \u043e\u0448\u0438\u0431\u043e\u043a:<\/p>\n<p> <\/p>\n<ol>\n<li>V522 Dereferencing of the null pointer &#8216;pBufInfo&#8217; might take place. groupcacheoperator.c 391<\/li>\n<li>V522 Dereferencing of the null pointer &#8216;item&#8217; might take place. scanoperator.c 4756<\/li>\n<li>V522 Dereferencing of the null pointer &#8216;pTrans&#8217; might take place. mndCompact.c 710<\/li>\n<li>V522 Dereferencing of the null pointer &#8216;pEntry&#8217; might take place. syncPipeline.c 885<\/li>\n<\/ol>\n<p> <\/p>\n<h3 id=\"oshibki-n7n10-nepravilnoe-ispolzovanie-assert\">\u041e\u0448\u0438\u0431\u043a\u0438 N7\u2013N10. \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 assert<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">template &lt;typename It&gt; static void linkResultDirectedEdges(It first, It last) \/\/ throw(TopologyException); {   for(; first != last; ++first) {     Node* node = *first;     assert(node);      EdgeEndStar* ees = node-&gt;getEdges();     assert(ees);     DirectedEdgeStar* des = dynamic_cast&lt;DirectedEdgeStar*&gt;(ees);     assert(des);      \/\/ this might throw an exception     des-&gt;linkResultDirectedEdges();   } }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> There might be dereferencing of a potential null pointer &#8216;des&#8217;. PlanarGraph.h 98<\/p>\n<p> <\/p>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>dynamic_cast<\/code> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>assert<\/code> \u2014 \u044f\u0432\u043d\u043e \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431. \u0422\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u0430\u043b\u043e \u0447\u0435\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u0430 \u0438 \u0431\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>assert<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0430\u043a\u0440\u043e\u0441 <code>assert<\/code> \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u043d\u0438\u0447\u0442\u043e, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p> <\/p>\n<p>\u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 (<code>assert<\/code>) \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u0445. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>dynamic_cast<\/code>, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f, \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u2014 \u044d\u0442\u043e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>static_cast<\/code>. \u0421\u043c. \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0440\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0442\u0435\u043c\u0443: &#171;<a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1104\/\">\u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 malloc c \u043f\u043e\u043c\u043e\u0449\u044c\u044e assert \u043f\u043b\u043e\u0445\u0430\u044f \u0438\u0434\u0435\u044f<\/a>&#171;.<\/p>\n<p> <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>assert<\/code> \u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>if<\/code> \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0439.<\/p>\n<p> <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<p> <\/p>\n<ol>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;nextedge&#8217;. LineMergeDirectedEdge.cpp 64<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;edge&#8217;. EdgeRing.cpp 225<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;point&#8217;. PointGeometryUnion.cpp 52<\/li>\n<\/ol>\n<p> <\/p>\n<h3 id=\"oshibki-n11n13-eschyo-bolee-smelyy-dynamic_cast\">\u041e\u0448\u0438\u0431\u043a\u0438 N11\u2013N13. \u0415\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0441\u043c\u0435\u043b\u044b\u0439 dynamic_cast<\/h3>\n<p> <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>dynamic_cast<\/code>. \u041d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>nextedge-&gt;getEdgeDirection()<\/code>.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">LineMergeDirectedEdge* LineMergeDirectedEdge::getNext(bool checkDirection) {   ....   if(getToNode()-&gt;getOutEdges()-&gt;getEdges()[0] == getSym()) {     auto nextedge = dynamic_cast&lt;LineMergeDirectedEdge*&gt;(       getToNode()-&gt;getOutEdges()-&gt;getEdges()[1]);     return (!checkDirection || nextedge-&gt;getEdgeDirection()) ?       nextedge : nullptr;   }   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> There might be dereferencing of a potential null pointer &#8216;nextedge&#8217;. LineMergeDirectedEdge.cpp 57<\/p>\n<p> <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <code>dynamic_cast<\/code> \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>static_cast<\/code>. \u042d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u044f\u0441\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u043c, \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p> <\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">auto nextedge = dynamic_cast&lt;LineMergeDirectedEdge*&gt;(   getToNode()-&gt;getOutEdges()-&gt;getEdges()[1]); return (!checkDirection ||         (nextedge &amp;&amp; nextedge-&gt;getEdgeDirection())) ?   nextedge : nullptr;<\/code><\/pre>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f, \u0430 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043c\u0435\u043d\u0435\u0435 \u043f\u043b\u043e\u0442\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">auto nextedge = dynamic_cast&lt;LineMergeDirectedEdge*&gt;(   getToNode()-&gt;getOutEdges()-&gt;getEdges()[1]);  if (!checkDirection ||     (nextedge &amp;&amp; nextedge-&gt;getEdgeDirection())) {   return nextedge; } return nullptr;<\/code><\/pre>\n<p> <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<p> <\/p>\n<ol>\n<li>V522 There might be dereferencing of a potential null pointer. EdgeRing.cpp 300<\/li>\n<li>V522 There might be dereferencing of a potential null pointer. EdgeRing.cpp 318<\/li>\n<\/ol>\n<p> <\/p>\n<h3 id=\"oshibka-n14-makrosy\">\u041e\u0448\u0438\u0431\u043a\u0430 N14. \u041c\u0430\u043a\u0440\u043e\u0441\u044b&#8230;<\/h3>\n<p> <\/p>\n<p>\u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1238\/\">\u043c\u0430\u043a\u0440\u043e\u0441, \u043f\u043e\u0436\u0438\u0440\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0435\u043a<\/a>? \u0412 \u043d\u0435\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u0442\u0430\u0438\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u043e\u0431\u0437\u043e\u0440\u0435 \u043a\u043e\u0434\u0430. \u0421\u0435\u0439\u0447\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 &#171;\u043c\u0430\u043a\u0440\u043e\u0441\u043d\u043e\u0433\u043e \u0431\u0435\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u044f&#187;.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">int32_t qWorkerInit(....) {   ....   if (NULL == mgmt-&gt;schHash) {     taosMemoryFreeClear(mgmt);     qError(\"init %d scheduler hash failed\", mgmt-&gt;cfg.maxSchedulerNum);     QW_ERR_JRET(terrno);   }   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u0412\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443? \u0414\u0443\u043c\u0430\u044e, \u043d\u0435\u0442. \u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<p> <\/p>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0437\u0434\u0435\u0441\u044c \u0442\u043e, \u0447\u0442\u043e <code>taosMemoryFreeClear<\/code> \u2014 \u044d\u0442\u043e \u043d\u0435 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u043c\u0430\u043a\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u0435\u0449\u0451 \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">#define taosMemoryFreeClear(ptr)   \\   do {                             \\     if (ptr) {                     \\       taosMemoryFree((void *)ptr); \\       (ptr) = NULL;                \\     }                              \\   } while (0)<\/code><\/pre>\n<p> <\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> Dereferencing of the null pointer &#8216;mgmt&#8217; might take place. qworker.c 1442<\/p>\n<p> <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>qError<\/code> \u0434\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">if (NULL == mgmt-&gt;schHash) {   qError(\"init %d scheduler hash failed\", mgmt-&gt;cfg.maxSchedulerNum);   taosMemoryFreeClear(mgmt);   QW_ERR_JRET(terrno); }<\/code><\/pre>\n<p> <\/p>\n<p>\u041e\u0445 \u0443\u0436 \u044d\u0442\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b.<\/p>\n<p> <\/p>\n<h3 id=\"oshibki-n15n112-otsutstvie-proverok-pri-vydelenii-pamyati\">\u041e\u0448\u0438\u0431\u043a\u0438 N15\u2013N112. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043f\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438<\/h3>\n<p> <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 TDengine \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0435\u0437\u0430\u043b\u0430\u0431\u0435\u0440\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>malloc<\/em> (\u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439). \u041c\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0435\u0441\u0442\u044c:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">void* buf = taosMemoryMalloc(tlen); if (NULL == buf) {   taosArrayDestroy(reqNew.pArray);   tDeleteSVCreateTbBatchReq(&amp;req);   goto end; }<\/code><\/pre>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0445 \u043d\u0435\u0442. \u042d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u043b\u043e\u0445\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f IoT \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432:<\/p>\n<p> <\/p>\n<ol>\n<li>\u0414\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043a\u0430\u043a \u0438 \u0433\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e.<\/li>\n<li>IoT \u2014 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0433\u0434\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c. \u041d\u0430 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0443\u0436 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/li>\n<li>\u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0443\u043f\u0430\u0441\u0442\u044c \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u0437-\u0437\u0430 \u043d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0414\u0430 \u0435\u0449\u0451, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u044f \u043a \u043d\u0435\u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<\/ol>\n<p> <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &#171;<a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0938\/\">\u0427\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \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>&#171;. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0443 \u0432\u0430\u0441 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 <code>malloc<\/code>, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e \u043a\u0440\u0443\u0433\u0443 \u0434\u043e \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0441\u0432\u0435\u0442\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p> <\/p>\n<p>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 TDengine? \u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043a\u0443\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">taos_linked_list_t *taos_linked_list_new(void) {   taos_linked_list_t *self =     (taos_linked_list_t *)taos_malloc(sizeof(taos_linked_list_t));   self-&gt;head = NULL;   self-&gt;tail = NULL;   self-&gt;free_fn = NULL;   self-&gt;compare_fn = NULL;   self-&gt;size = 0;   return self; }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> There might be dereferencing of a potential null pointer &#8216;self&#8217;. Check lines: 28, 27. taos_linked_list.c 28<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">unsigned char* SZ_skip_compress_double(double* data, size_t dataLength, size_t* outSize) {   *outSize = dataLength*sizeof(double);   unsigned char* out = (unsigned char*)malloc(dataLength*sizeof(double));   memcpy(out, data, dataLength*sizeof(double));   return out; }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\">V575<\/a> The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 28, 27. sz_double.c 28<\/p>\n<p> <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0414\u0440\u0443\u0433\u0438\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f.<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<ol>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;* coeff_array&#8217;. Check lines: 304, 303. dataCompression.c 304<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;keys&#8217;. Check lines: 344, 333. iniparser.c 344<\/li>\n<li>V522 Dereferencing of the null pointer &#8216;vce&#8217; might take place. The potential null pointer is passed into &#8216;compressSingleFloatValue&#8217; function. Inspect the first argument. Check lines: 209, 439, 433. dataCompression.c 209<\/li>\n<li>V522 Dereferencing of the null pointer &#8216;lce&#8217; might take place. The potential null pointer is passed into &#8216;addExactData&#8217; function. Inspect the fourth argument. Check lines: 275, 442, 434. dataCompression.c 275<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;* decData&#8217;. Check lines: 514, 463. dataCompression.c 514<\/li>\n<li>V522 Dereferencing of the null pointer &#8216;vce&#8217; might take place. The potential null pointer is passed into &#8216;compressSingleDoubleValue&#8217; function. Inspect the first argument. Check lines: 234, 575, 569. dataCompression.c 234<\/li>\n<li>V522 Dereferencing of the null pointer &#8216;lce&#8217; might take place. The potential null pointer is passed into &#8216;addExactData&#8217; function. Inspect the fourth argument. Check lines: 275, 578, 570. dataCompression.c 275<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;result&#8217;. Check lines: 143, 134. CompressElement.c 143<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;type&#8217;. Check lines: 152, 122. szd_double.c 152<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;* dia&#8217;. Check lines: 18, 17. DynamicIntArray.c 18<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;type&#8217;. Check lines: 130, 107. sz_double.c 130<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;vce&#8217;. Check lines: 132, 126. sz_double.c 132<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;types&#8217;. Check lines: 160, 129. szd_float.c 160<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;type2code&#8217;. Check lines: 48, 43. transcode.c 48<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;diff&#8217;. Check lines: 49, 44. transcode.c 49<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;tp_code&#8217;. Check lines: 63, 36. transcode.c 63<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;tp_code&#8217;. Check lines: 146, 106. transcode.c 146<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;type&#8217;. Check lines: 138, 114. sz_float.c 138<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;vce&#8217;. Check lines: 141, 134. sz_float.c 141<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;* dba&#8217;. Check lines: 18, 17. DynamicByteArray.c 18<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;huffmanTree-&gt;code[n-&gt;c]&#8217;. Check lines: 129, 125. Huffman.c 129<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;* out&#8217;. Check lines: 425, 424. Huffman.c 425<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;symbol&#8217;. Check lines: 633, 632. dumper.c 633<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;stackTrace&#8217;. Check lines: 716, 715. dumper.c 716<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;subgeomArray&#8217;. Check lines: 2084, 2082. geos_ts_c.cpp 2084<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;* vgroup_ids&#8217;. Check lines: 97, 83. taos_counter.c 97<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;* keys&#8217;. Check lines: 98, 88. taos_counter.c 98<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;node&#8217;. Check lines: 92, 90. taos_linked_list.c 92<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;node&#8217;. Check lines: 108, 106. taos_linked_list.c 108<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;self&#8217;. Check lines: 42, 41. taos_map.c 42<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;self&#8217;. Check lines: 78, 77. taos_map.c 78<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;self-&gt;addrs&#8217;. Check lines: 98, 94. taos_map.c 98<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;new_addrs&#8217;. Check lines: 287, 283. taos_map.c 287<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;self&#8217;. Check lines: 35, 34. taos_metric_formatter.c 35<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;k&#8217;. Check lines: 60, 47. taos_metric.c 60<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;self&#8217;. Check lines: 45, 44. taos_string_builder.c 45<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;self-&gt;str&#8217;. Check lines: 59, 58. taos_string_builder.c 59<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;self&#8217;. Check lines: 49, 47. taos_collector_registry.c 49<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;self&#8217;. Check lines: 39, 38. taos_metric_sample.c 39<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;e&#8217;. Check lines: 532, 530. lru_cache.cc 532<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;column_families&#8217;. Check lines: 1038, 1036. c.cc 1038<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;cf_names&#8217;. Check lines: 2526, 2522. c.cc 2526<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;cf_options&#8217;. Check lines: 2527, 2523. c.cc 2527<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;level_meta&#8217;. Check lines: 5308, 5307. c.cc 5308<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;file_meta&#8217;. Check lines: 5339, 5338. c.cc 5339<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;buf&#8217;. Check lines: 5599, 5596. c.cc 5599<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;wi&#8217;. Check lines: 5627, 5626. c.cc 5627<\/li>\n<li>V522 There might be dereferencing of a potential null pointer &#8216;result&#8217;. Check lines: 5672, 5671. c.cc 5672<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 51, 50. sz_double.c 51<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 273, 272. sz_double.c 273<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 380, 379. sz_double.c 380<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 47, 46. sz_float.c 47<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 275, 274. sz_float.c 275<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 402, 401. sz_float.c 402<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 33, 27. DynamicByteArray.c 33<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 20, 19. Huffman.c 20<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 29, 24. Huffman.c 29<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 30, 25. Huffman.c 30<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 31, 26. Huffman.c 31<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 32, 27. Huffman.c 32<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 172, 171. Huffman.c 172<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 194, 193. Huffman.c 194<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 413, 412. Huffman.c 413<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 415, 414. Huffman.c 415<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 417, 416. Huffman.c 417<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 419, 418. Huffman.c 419<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 440, 439. Huffman.c 440<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 442, 441. Huffman.c 442<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 444, 443. Huffman.c 444<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 446, 445. Huffman.c 446<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 464, 463. Huffman.c 464<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 466, 465. Huffman.c 466<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 468, 467. Huffman.c 468<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 470, 469. Huffman.c 470<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 566, 565. Huffman.c 566<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 568, 567. Huffman.c 568<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 570, 569. Huffman.c 570<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 572, 571. Huffman.c 572<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 603, 602. Huffman.c 603<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 605, 604. Huffman.c 605<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 607, 606. Huffman.c 607<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 609, 608. Huffman.c 609<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 656, 655. Huffman.c 656<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 658, 657. Huffman.c 658<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 660, 659. Huffman.c 660<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 662, 661. Huffman.c 662<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 710, 708. Huffman.c 710<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 22, 21. TightDataPointStorageF.c 22<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 194, 193. TightDataPointStorageF.c 194<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 22, 21. TightDataPointStorageD.c 22<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 194, 193. TightDataPointStorageD.c 194<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 3320, 3319. geos_ts_c.cpp 3320<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 3337, 3336. geos_ts_c.cpp 3337<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memset&#8217; function. Inspect the first argument. Check lines: 42, 41. taos_metric.c 42<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 145, 144. taos_string_builder.c 145<\/li>\n<li>V575 The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 533, 532. c.cc 533<\/li>\n<\/ol>\n<\/div><\/div>\n<p> <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong> \u041a\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0435 \u043a TDengine, \u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c. \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u044f \u043f\u0438\u0441\u0430\u043b, \u0447\u0442\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430. \u041f\u043e\u0432\u0442\u043e\u0440\u044e \u0435\u0449\u0451 \u0440\u0430\u0437: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u0443\u043f\u0430\u0434\u0451\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 TDengine \u0438\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 TDengine. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u043e \u0438 \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043a\u043e\u0434.<\/p>\n<p> <\/p>\n<h3 id=\"oshibki-n113n130-na-samom-dele-bolshe-razymenovanie-ukazatelya-do-ego-proverki\">\u041e\u0448\u0438\u0431\u043a\u0438 N113\u2013N130 (\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435). \u0420\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0434\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/h3>\n<p> <\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043e\u0448\u0438\u0431\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u043a\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u043d\u0430 C \u0438 C++. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u043e\u043b\u044c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0443\u0434\u0430 \u0440\u0435\u0436\u0435, \u0447\u0435\u043c \u043e\u043d\u0438 \u043e\u0436\u0438\u0434\u0430\u044e\u0442. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043c\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/video\/11052\/\">\u0434\u043e\u043a\u043b\u0430\u0434<\/a> \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443.<\/p>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/681b5b6b8f844fa824a57331\" data-style=\"\" id=\"681b5b6b8f844fa824a57331\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430\u0437\u044b\u0432\u0430\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u043e\u043d\u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u0440\u0430\u0432\u044b. \u0412\u043e\u0442 \u0447\u0435\u0433\u043e-\u0447\u0435\u0433\u043e, \u0442\u0430\u043a \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c.<\/p>\n<p> <\/p>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \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\">bool RectangleIntersection::clip_linestring_parts(   const geom::LineString* gi, ....) {   auto n = gi-&gt;getNumPoints();    if(gi == nullptr || n &lt; 1) {     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: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\">V595<\/a> The &#8216;gi&#8217; pointer was utilized before it was verified against nullptr. Check lines: 137, 139. RectangleIntersection.cpp 137<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <code>gi<\/code> \u044f\u0432\u043d\u043e \u0437\u0430\u043f\u043e\u0437\u0434\u0430\u043b\u0430. \u0414\u0443\u043c\u0430\u044e, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442.<\/p>\n<p> <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">int32_t tsortOpen(SSortHandle* pHandle) {   int32_t code = 0;   if (pHandle-&gt;opened) {     return code;   }    if (pHandle == NULL || pHandle-&gt;fetchfp == NULL ||       pHandle-&gt;comparFn == NULL) {     return TSDB_CODE_INVALID_PARA;   }   .... }<\/code><\/pre>\n<p> <\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\">V595<\/a> The &#8216;pHandle&#8217; pointer was utilized before it was verified against nullptr. Check lines: 2883, 2887. tsort.c 2883<\/p>\n<p> <\/p>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0451 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435. \u0411\u044b\u0432\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438, \u043d\u043e, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0441\u043c\u044b\u0441\u043b \u043f\u043e\u043d\u044f\u0442\u0435\u043d. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\">V595<\/a> \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0432\u0430\u043c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0439, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u043e\u0439: &#171;<a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\">\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 V595<\/a>&#171;. \u0417\u0430\u043c\u0435\u0442\u043a\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 10 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u0438 \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439, \u0438 \u043e\u043d\u0430 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0431\u0430\u0433\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0435\u0439 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p> <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<ol>\n<li>V595 The &#8216;col&#8217; pointer was utilized before it was verified against nullptr. Check lines: 2075, 2076. geos_ts_c.cpp 2075<\/li>\n<li>V595 The &#8216;keys&#8217; pointer was utilized before it was verified against nullptr. Check lines: 88, 89. taos_counter.c 88<\/li>\n<li>V595 The &#8216;dbCache&#8217; pointer was utilized before it was verified against nullptr. Check lines: 196, 199. ctgCache.c 196<\/li>\n<li>V595 The &#8216;pDbCache&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1631, 1633. ctgCache.c 1631<\/li>\n<li>V595 The &#8216;pInfo-&gt;pState&#8217; pointer was utilized before it was verified against nullptr. Check lines: 155, 158. streamfilloperator.c 155<\/li>\n<li>V595 The &#8216;pFillInfo&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1582, 1588. streamfilloperator.c 1582<\/li>\n<li>V595 The &#8216;string&#8217; pointer was utilized before it was verified against nullptr. Check lines: 869, 870. mndTopic.c 869<\/li>\n<li>V595 The &#8216;pFile&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1351, 1353. osFile.c 1351<\/li>\n<li>V595 The &#8216;bins&#8217; pointer was utilized before it was verified against nullptr. Check lines: 4267, 4268. sclfunc.c 4267<\/li>\n<li>V595 The &#8216;pCtx-&gt;freeFunc&#8217; pointer was utilized before it was verified against nullptr. Check lines: 351, 358. schUtil.c 351<\/li>\n<li>V595 The &#8216;pNodeList&#8217; pointer was utilized before it was verified against nullptr. Check lines: 481, 482. clientImpl.c 481<\/li>\n<li>V595 The &#8216;pReq&#8217; pointer was utilized before it was verified against nullptr. Check lines: 2831, 2832. clientImpl.c 2831<\/li>\n<li>V595 The &#8216;vgroup_ids&#8217; pointer was utilized before it was verified against nullptr. Check lines: 83, 84. taos_counter.c 83<\/li>\n<li>V595 The &#8216;pReq&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1214, 1215. transCli.c 1214<\/li>\n<li>V595 The &#8216;pReq&#8217; pointer was utilized before it was verified against nullptr. Check lines: 2755, 2758. transCli.c 2755<\/li>\n<li>V595 The &#8216;pReq&#8217; pointer was utilized before it was verified against nullptr. Check lines: 3364, 3380. transCli.c 3364<\/li>\n<li><strong>\u0417\u0434\u0435\u0441\u044c \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0441\u043a\u0443\u0447\u043d\u043e<\/strong> \u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u043b \u0432\u044b\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0431\u043e\u043b\u044c\u0448\u0435.<\/li>\n<\/ol>\n<\/div><\/div>\n<p> <\/p>\n<h2 id=\"utechka-resursov\">\u0423\u0442\u0435\u0447\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/h2>\n<p> <\/p>\n<p>\u0420\u0443\u0447\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0447\u0440\u0435\u0432\u0430\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438. \u041f\u0440\u043e\u0435\u043a\u0442 TDengine \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 C, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435\u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0438 \u0432 \u043d\u0451\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p> <\/p>\n<p>\u0413\u041e\u0421\u0422 \u0420 71207\u20142024 \u043f\u0440\u0438\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0435\u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c (\u043f. 6.5.\u0435). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0410\u043d\u043d\u0430 \u041c\u0435\u043b\u0438\u0445\u043e\u0432\u0430 \u0438\u0437 \u041b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u043e\u0433\u043e \u0432 \u0434\u043e\u043a\u043b\u0430\u0434\u0435 &#171;<a href=\"https:\/\/sysconf.pro\/talks\/f7ffe3773b1f4569974ac25b4d0733bb\/\">\u041d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c: \u043d\u0443\u0436\u043d\u043e, \u043c\u043e\u0436\u043d\u043e, \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c<\/a>&#187; \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0443\u0442\u0435\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440.<\/p>\n<p> <\/p>\n<h3 id=\"oshibki-n131n140-utechka-pamyati-na-odnom-iz-putey-vypolneniya-programmy\">\u041e\u0448\u0438\u0431\u043a\u0438 N131\u2013N140. \u0423\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0443\u0442\u0435\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">taos_map_t *taos_map_new() {   int r = 0;    taos_map_t *self = (taos_map_t *)taos_malloc(sizeof(taos_map_t));   self-&gt;size = 0;   self-&gt;max_size = TAOS_MAP_INITIAL_SIZE;    self-&gt;keys = taos_linked_list_new();   if (self-&gt;keys == NULL) return NULL;   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v773\/\">V773<\/a> The function was exited without releasing the &#8216;self&#8217; pointer. A memory leak is possible. taos_map.c 82<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>taos_map_new<\/code> \u0434\u043e\u0441\u0440\u043e\u0447\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0431\u0443\u0444\u0435\u0440 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435 <code>self<\/code>. <\/p>\n<p> <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u0445\u043e\u0436\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<ol>\n<li>V773 The function was exited without releasing the &#8216;new_addrs&#8217; pointer. A memory leak is possible. taos_map.c 289<\/li>\n<li>V773 The function was exited without releasing the &#8216;k&#8217; pointer. A memory leak is possible. taos_metric.c 52<\/li>\n<li>V773 The function was exited without releasing the &#8216;new_nexts&#8217; pointer. A memory leak is possible. regex_internal.c 1421<\/li>\n<li>V773 The function was exited without releasing the &#8216;new_indices&#8217; pointer. A memory leak is possible. regex_internal.c 1421<\/li>\n<li>V773 The function was exited without releasing the &#8216;new_edests&#8217; pointer. A memory leak is possible. regex_internal.c 1421<\/li>\n<li>V773 The function was exited without releasing the &#8216;new_eclosures&#8217; pointer. A memory leak is possible. regex_internal.c 1421<\/li>\n<li>V773 The function was exited without releasing the &#8216;self&#8217; pointer. A memory leak is possible. taos_collector_registry.c 53<\/li>\n<li>V773 The function was exited without releasing the &#8216;new_start&#8217; pointer. A memory leak is possible. regexec.c 534<\/li>\n<li>V773 The function was exited without releasing the &#8216;new_end&#8217; pointer. A memory leak is possible. regexec.c 534<\/li>\n<\/ol>\n<\/div><\/div>\n<p> <\/p>\n<h3 id=\"oshibki-n141n144-neakkuratnoe-ispolzovanie-funkcii-realloc\">\u041e\u0448\u0438\u0431\u043a\u0438 N141\u2013N144. \u041d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 realloc<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">INLINE void addDIA_Data(DynamicIntArray *dia, int value) {   if(dia-&gt;size==dia-&gt;capacity)   {     dia-&gt;capacity = dia-&gt;capacity &lt;&lt; 1;     dia-&gt;array = (unsigned char *)       realloc(dia-&gt;array, dia-&gt;capacity*sizeof(unsigned char));   }   dia-&gt;array[dia-&gt;size] = (unsigned char)value;   dia-&gt;size ++; }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v701\/\">V701<\/a> realloc() possible leak: when realloc() fails in allocating memory, original pointer &#8216;dia-&gt;array&#8217; is lost. Consider assigning realloc() to a temporary pointer. DynamicIntArray.c 54<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/en.cppreference.com\/w\/c\/memory\/realloc\"><code>realloc<\/code><\/a> \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0431\u0443\u0444\u0435\u0440, \u0442\u043e \u043e\u043d\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 <code>NULL<\/code>. \u0421\u0442\u0430\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <code>dia-&gt;array<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043e \u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440, \u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u043d\u0435\u0435 \u0432 \u043d\u0451\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0441\u044f.<\/p>\n<p> <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0434\u0430\u043b\u0435\u0435 \u043d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0443\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u0442\u043e\u0440\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u0430. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>realloc<\/code>.<\/p>\n<p> <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/strong>. \u041a\u0441\u0442\u0430\u0442\u0438, \u044d\u0442\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0442\u0435\u043c, \u043a \u043a\u0430\u043a\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0434\u0435\u0441\u044c:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">dia-&gt;array[dia-&gt;size] = (unsigned char)value;<\/code><\/pre>\n<p> <\/p>\n<p>\u0411\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u043f\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e, \u0430 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0442\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b. \u0412\u043e\u0437\u043c\u043e\u0436\u0435\u043d <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/0063\/\">Access Violation<\/a>. \u0410 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u0440\u0447\u0435\u043d\u044b \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0443, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043d\u0430 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f. \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \ud83d\ude42<\/p>\n<p> <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<p> <\/p>\n<ol>\n<li>V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer &#8216;dba-&gt;array&#8217; is lost. Consider assigning realloc() to a temporary pointer. DynamicByteArray.c 57<\/li>\n<li>V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer &#8216;dba-&gt;array&#8217; is lost. Consider assigning realloc() to a temporary pointer. DynamicByteArray.c 68<\/li>\n<li>V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer &#8216;self-&gt;str&#8217; is lost. Consider assigning realloc() to a temporary pointer. taos_string_builder.c 84<\/li>\n<\/ol>\n<p> <\/p>\n<h3 id=\"oshibki-n145n157-neakkuratnoe-ispolzovanie-funkcii-emplace_back\">\u041e\u0448\u0438\u0431\u043a\u0438 N145\u2013N157. \u041d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 emplace_back<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">Status SstFileWriter::Open(const std::string&amp; file_path) {   ....   for (size_t i = 0; i &lt; user_collector_factories.size(); i++) {     int_tbl_prop_collector_factories.emplace_back(         new UserKeyTablePropertiesCollectorFactory(             user_collector_factories[i]));   }   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1023\/\">V1023<\/a> A pointer without owner is added to the &#8216;int_tbl_prop_collector_factories&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. sst_file_writer.cc 298<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u043b\u043e\u043d, \u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438. \u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <code>std::bad_alloc<\/code>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d, \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0451\u043d.<\/p>\n<p> <\/p>\n<p>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0449\u0430\u044f \u043e\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">int_tbl_prop_collector_factories.emplace_back(   std::make_unique&lt;UserKeyTablePropertiesCollectorFactory&gt;(     user_collector_factories[i]));<\/code><\/pre>\n<p> <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f.<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<ol>\n<li>V1023 A pointer without owner is added to the &#8216;locations&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. ConnectedElementLocationFilter.cpp 54<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;locations&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. ConnectedElementLocationFilter.cpp 67<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;outOERs&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. MaximalEdgeRing.cpp 117<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;edgeRings&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. PolygonBuilder.cpp 87<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;copied_operands_&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. merge_context.h 41<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;copied_operands_&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. merge_context.h 57<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;jobs&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. db_impl_compaction_flush.cc 458<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;parent_iters_&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. range_del_aggregator.cc 373<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;builder_guards&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. version_set.cc 5026<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;table_properties_collectors&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. block_based_table_builder.cc 533<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;table_properties_collectors&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. block_based_table_builder.cc 540<\/li>\n<li>V1023 A pointer without owner is added to the &#8216;int_tbl_prop_collector_factories&#8217; container by the &#8217;emplace_back&#8217; method. A memory leak will occur in case of an exception. sst_file_writer.cc 290<\/li>\n<\/ol>\n<\/div><\/div>\n<p> <\/p>\n<h2 id=\"vyhod-za-granicu-buferamassiva\">\u0412\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u0443\u0444\u0435\u0440\u0430\/\u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/h2>\n<p> <\/p>\n<p>\u041f\u043b\u0430\u0442\u043e\u0439 \u0437\u0430 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u044f\u0437\u044b\u043a\u043e\u0432 C \u0438 C++ \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043e\u0442\u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u0443\u044e\u0442 \u0430\u0441\u043a\u0435\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 \u044f\u0437\u044b\u043a\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u044f\u0432\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u0443\u0444\u0435\u0440\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a PVS-Studio, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p> <\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0413\u041e\u0421\u0422 \u0420 71207\u20142024 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043a \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c (\u043f. 6.3.\u0432.). \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f (\u0420\u0411\u041f\u041e), \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u0435 \u0432\u0438\u0434\u044b \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0438\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio.<\/p>\n<p> <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u044b\u0432. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430 \u043d\u0430 \u0442\u0435\u043c\u0443 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435.<\/p>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/66e97cead1b5b66d8d242323\" data-style=\"\" id=\"66e97cead1b5b66d8d242323\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<p>\u0410\u043d\u0434\u0440\u0435\u0439 \u041a\u0430\u0440\u043f\u043e\u0432. <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/video\/11084\/\">\u0413\u041e\u0421\u0422 \u0420 71207\u20132024 \u2014 \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f. \u041a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/a>.<\/p>\n<p> <\/p>\n<h3 id=\"oshibka-n158-vyhod-za-granicu-bufera\">\u041e\u0448\u0438\u0431\u043a\u0430 N158. \u0412\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u0443\u0444\u0435\u0440\u0430<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">const char* rocksdb_iter_value(const rocksdb_iterator_t* iter, size_t* vlen) {   Slice s = iter-&gt;rep-&gt;value();   *vlen = s.size();   return s.data(); }  int32_t streamDefaultIterGet_rocksdb(....) {   ....   while (rocksdb_iter_valid(pIter)) {     const char* key = rocksdb_iter_key(pIter, &amp;klen);     int32_t     vlen = 0;     const char* vval = rocksdb_iter_value(pIter, (size_t*)&amp;vlen);   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v512\/\">V512<\/a> A call of the &#8216;rocksdb_iter_value&#8217; function will lead to overflow of the buffer &#8216;&amp; vlen&#8217;. streamBackendRocksdb.c 4390<\/p>\n<p> <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c 32-\u0431\u0438\u0442\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u0430 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435 \u043e\u043d \u0434\u0430\u0441\u0442 \u0441\u0431\u043e\u0439.<\/p>\n<p> <\/p>\n<p>\u0410\u0434\u0440\u0435\u0441 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>vlen<\/code> \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0438\u043f <code>size_t<\/code>:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">int32_t     vlen = 0; const char* vval = rocksdb_iter_value(pIter, (size_t*)&amp;vlen);<\/code><\/pre>\n<p> <\/p>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>rocksdb_iter_value<\/code> \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <code>size_t<\/code>.<\/p>\n<p> <\/p>\n<p>\u0412 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b) \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>size_t<\/code> \u0440\u0430\u0432\u0435\u043d 4 \u0431\u0430\u0439\u0442\u0430\u043c \u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0442\u0438\u043f\u0430 <code>int32_t<\/code>. \u041a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p> <\/p>\n<p>\u0412 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0438\u043f\u0430 <code>size_t<\/code> \u0440\u0430\u0432\u0435\u043d 8 \u0431\u0430\u0439\u0442\u0430\u043c. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 64-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>vlen<\/code> \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0412 \u043e\u0431\u0449\u0435\u043c, 4 \u0431\u0430\u0439\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0441\u0442\u0435\u043a \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p> <\/p>\n<h3 id=\"oshibka-n159-vyhod-za-granicu-bufera-iz-za-putanicy-v-konstantah\">\u041e\u0448\u0438\u0431\u043a\u0430 N159. \u0412\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u0443\u0444\u0435\u0440\u0430 \u0438\u0437-\u0437\u0430 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u0445<\/h3>\n<p> <\/p>\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e <code>MAX_QUERY_VALUE_LEN<\/code> \u044d\u0442\u043e 1024:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">#define MAX_QUERY_VALUE_LEN       1024<\/code><\/pre>\n<p> <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0442\u0440\u0435\u0442\u044c\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>char data[100][100][1024]<\/code> \u044d\u0442\u043e \u0442\u043e\u0436\u0435 1024:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">typedef struct _script_t {   ....   char              cols[12];   char              data[100][100][1024];   char              system_exit_code[12];   .... } SScript;<\/code><\/pre>\n<p> <\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043a\u043e\u0434 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {   ....   char *value = NULL;   if (i &lt; MAX_QUERY_COL_NUM) {     value = script-&gt;data[numOfRows][i];   }   if (value == NULL) {     continue;   }   ....   int32_t    *length = taos_fetch_lengths(pSql);   ....   if (length[i] &lt; 0 || length[i] &gt; 1 &lt;&lt; 20) {     fprintf(stderr, \"Invalid length(%d) of BINARY or NCHAR\\n\", length[i]);     exit(-1);   }   memset(value, 0, MAX_QUERY_VALUE_LEN);   memcpy(value, row[i], length[i]);   value[length[i]] = 0;     .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v512\/\">V512<\/a> A call of the &#8216;memcpy&#8217; function will lead to overflow of the buffer &#8216;value&#8217;. simExec.c 786<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043b\u0435\u0436\u0430\u0449\u0435\u0435 \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>length[i]<\/code>. \u041e\u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">if (length[i] &lt; 0 || length[i] &gt; 1 &lt;&lt; 20) {   fprintf(stderr, \"Invalid length(%d) of BINARY or NCHAR\\n\", length[i]);   exit(-1); }<\/code><\/pre>\n<p> <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">memcpy(value, row[i], length[i]);<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>1 &lt;&lt; 20<\/code> \u044d\u0442\u043e \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 1024, \u0430 1048576. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430. \u0414\u0443\u043c\u0430\u044e, \u0432\u0435\u0440\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043d\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0430 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 <code>MAX_QUERY_VALUE_LEN<\/code>. \u042d\u0442\u0443 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">char        data[100][100][MAX_QUERY_VALUE_LEN];   .... if (length[i] &lt; 0 || length[i] &gt; MAX_QUERY_VALUE_LEN) {   fprintf(stderr, \"Invalid length(%d) of BINARY or NCHAR\\n\", length[i]);   exit(-1); } memset(value, 0, MAX_QUERY_VALUE_LEN); memcpy(value, row[i], length[i]);<\/code><\/pre>\n<p> <\/p>\n<p>\u041e\u0439, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0435\u0441\u0442\u044c:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">value[length[i]] = 0;<\/code><\/pre>\n<p> <\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0438 \u0434\u0430\u0436\u0435 \u0432\u0440\u0435\u0434\u043d\u0430. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0436\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u043d\u0443\u043b\u044f\u043c\u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>memset<\/code> \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043b\u044c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0435\u0441\u043b\u0438 <code>length[i] == MAX_QUERY_VALUE_LEN<\/code>, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0412 \u043e\u0431\u0449\u0435\u043c, \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c.<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f. \u0420\u0430\u0437 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043b\u044c \u0432 \u043a\u043e\u043d\u0446\u0435, \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>MAX_QUERY_VALUE_LEN<\/code> \u0431\u0430\u0439\u0442. \u0422\u043e\u0433\u0434\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u0430 \u043f\u043e\u0434 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043b\u044c. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u0434\u043e \u0435\u0449\u0451 \u0440\u0430\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>&gt;=<\/code>, \u0430 \u043d\u0435 <code>&gt;<\/code>.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">if (length[i] &lt; 0 || length[i] &gt;= MAX_QUERY_VALUE_LEN)<\/code><\/pre>\n<p> <\/p>\n<h3 id=\"oshibka-n160-potencialnyy-vyhod-za-granicu-massiva\">\u041e\u0448\u0438\u0431\u043a\u0430 N160. \u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/h3>\n<p> <\/p>\n<p>\u041c\u0438\u043d\u0443\u0442\u043a\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u0412\u044b \u043e\u0441\u043e\u0437\u043d\u0430\u0451\u0442\u0435, \u0447\u0442\u043e \u043c\u044b \u0443\u0436\u0435 \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e 160 \u043e\u0448\u0438\u0431\u043a\u0438?!<\/p>\n<p> <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/93\/e-\/rd\/93e-rdeoc75zy3b9gdjorlknlh0.png\" alt=\"160 \u043e\u0448\u0438\u0431\u043e\u043a\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/93\/e-\/rd\/93e-rdeoc75zy3b9gdjorlknlh0.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/93\/e-\/rd\/93e-rdeoc75zy3b9gdjorlknlh0.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p> <\/p>\n<p>\u041e\u0441\u043e\u0437\u043d\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u0443\u0436\u0435 160 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u043f\u0440\u0438\u0441\u043a\u043e\u0440\u0431\u043d\u043e.<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u0438\u0447\u0451\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0413\u041e\u0421\u0422 \u0420 71207\u20142024 \u0432\u0441\u0451 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 \u2014 \u044d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f. \u0410 \u043d\u0435 \u0432\u043e\u0442 \u0442\u0430\u043a \u043a\u0443\u0447\u0435\u0439, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0433\u043e\u0434\u0430\u043c\u0438, \u0432\u0430\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p> <\/p>\n<blockquote><p>\u0413\u041e\u0421\u0422 \u0420 71207\u20142024 (\u043f. 5.9). \u0412\u044b\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e 5.7 \u0431\u044b\u043b\u0438 \u043e\u0442\u043d\u0435\u0441\u0435\u043d\u044b \u043a \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u043c, \u043d\u0435 \u043f\u043e\u0437\u0436\u0435, \u0447\u0435\u043c \u0447\u0435\u0440\u0435\u0437 10 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0434\u043d\u0435\u0439 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u0431\u043e \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u043e\u043a\u0438 \u0438\u0445 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u041f\u041e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0433\u0438\u0431\u043a\u0430\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e, \u0442\u043e \u043f\u043b\u0430\u043d \u043f\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0446\u0438\u043a\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u041f\u041e \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043d\u0435 \u043f\u043e\u0437\u0434\u043d\u0435\u0435 \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u041f\u041e.<\/p><\/blockquote>\n<p>\u041f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0443 TDengine \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \ud83d\ude42<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">dictionary * iniparser_load(const char * ininame) {   ....   char line    [ASCIILINESZ+1] ;   ....   memset(line,    0, ASCIILINESZ);   ....   last=0 ;    while (fgets(line+last, ASCIILINESZ-last, in)!=NULL) {     lineno++ ;     len = (int)strlen(line)-1;     if (len==0)       continue;     \/* Safety check against buffer overflows *\/     if (line[len]!='\\n') {       fprintf(stderr,               \"iniparser: input line too long in %s (%d)\\n\",               ininame,               lineno);       dictionary_del(dict);       fclose(in);       return NULL ;     }     .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v557\/\">V557<\/a> Array underrun is possible. The value of &#8216;len&#8217; index could reach -1. iniparser.c 695<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f <code>fgets<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>len<\/code> \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u0430 -1. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c, \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u043d\u0435\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &#171;<a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0599\/\">\u0421\u0442\u0440\u0435\u043b\u044f\u0435\u043c \u0432 \u043d\u043e\u0433\u0443, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/a>&#171;. \u0422\u0430\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p> <\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0432\u0441\u0451 \u044d\u0442\u043e, \u0437\u0430\u0431\u0430\u0432\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">\/* Safety check against buffer overflows *\/<\/code><\/pre>\n<p> <\/p>\n<h2 id=\"opechatki\">\u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0438<\/h2>\n<p> <\/p>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u044b \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439\/\u0441\u0441\u044b\u043b\u043e\u043a, \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043d\u043e\u043b\u044c. \u041e\u0434\u043d\u0438, \u043a\u0430\u043a C \u0438 C++, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430. \u0414\u0440\u0443\u0433\u0438\u0435 \u0436\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435 \u044f\u0437\u044b\u043a\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430\u043c\u0438. \u0421\u043b\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043d\u0438\u043c\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0432\u044b\u044f\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a. \u0414\u0430, \u044d\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0447\u0430\u0441\u0442\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0430 \u043d\u0435 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u0430\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f. \u041d\u043e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f.<\/p>\n<p> <\/p>\n<h3 id=\"oshibka-n161-perezapis-znacheniya\">\u041e\u0448\u0438\u0431\u043a\u0430 N161. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">static int32_t getRowsBlockWithinMergeLimit(....) {   ....   if (keepRows == 0) {     *pSkipBlock = true;     *pRes = pOrigBlk;   }    *pSkipBlock = false;   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v519\/\">V519<\/a> The &#8216;* pSkipBlock&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2198, 2202. tsort.c 2202<\/p>\n<p> <\/p>\n<p>\u0421\u0442\u0440\u043e\u0447\u043a\u0430 <code>*pSkipBlock = true<\/code> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0442\u043e\u043c \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <code>false<\/code>. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>else<\/code>:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">if (keepRows == 0) {   *pSkipBlock = true;   *pRes = pOrigBlk; } else {   *pSkipBlock = false; }<\/code><\/pre>\n<p> <\/p>\n<h3 id=\"oshibka-n162-povtor\">\u041e\u0448\u0438\u0431\u043a\u0430 N162. \u041f\u043e\u0432\u0442\u043e\u0440<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">static void processSimpleMeta(SMqMetaRsp* pMetaRsp, cJSON** meta) {   ...   } else if (pMetaRsp-&gt;resMsgType == TDMT_VND_ALTER_TABLE) {     processAlterTable(pMetaRsp, meta);   } else if (pMetaRsp-&gt;resMsgType == TDMT_VND_DROP_TABLE) {     processDropTable(pMetaRsp, meta);   } else if (pMetaRsp-&gt;resMsgType == TDMT_VND_DROP_TABLE) {     processDropTable(pMetaRsp, meta);   } else if (pMetaRsp-&gt;resMsgType == TDMT_VND_DELETE) {   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v517\/\">V517<\/a> The use of &#8216;if (A) {&#8230;} else if (A) {&#8230;}&#8217; pattern was detected. There is a probability of logical error presence. Check lines: 2316, 2318. clientRawBlockWrite.c 2316<\/p>\n<p> <\/p>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0431\u043b\u043e\u043a\u0438 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c copy-paste. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u0442\u0432\u043b\u0451\u043a\u0441\u044f, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">} else if (pMetaRsp-&gt;resMsgType == TDMT_VND_DROP_TABLE) {   processDropTable(pMetaRsp, meta);<\/code><\/pre>\n<p> <\/p>\n<p>\u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u043e\u0448\u0438\u0431\u043e\u043a. <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v517\/\">\u0423 \u043d\u0430\u0441 \u0438\u0445 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438<\/a>. \u0415\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0431\u043b\u043e\u043a\u043e\u0432 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0438\u0448\u043d\u0438\u043c, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u043d\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0425\u0443\u0436\u0435, \u0435\u0441\u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438 \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.<\/p>\n<p> <\/p>\n<h3 id=\"oshibka-n163-zabytyy-opasnyy-kod-gde-vozmozhno-delenie-na-0\">\u041e\u0448\u0438\u0431\u043a\u0430 N163. \u0417\u0430\u0431\u044b\u0442\u044b\u0439 \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434, \u0433\u0434\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 0<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">OffsetSegmentGenerator::OffsetSegmentGenerator(....) : .... {   ....   \/\/ compute intersections in full precision, to provide accuracy   \/\/ the points are rounded as they are inserted into the curve line   filletAngleQuantum = MATH_PI \/ 2.0 \/ bufParams.getQuadrantSegments();    int quadSegs = bufParams.getQuadrantSegments();   if (quadSegs &lt; 1) quadSegs = 1;   filletAngleQuantum = MATH_PI \/ 2.0 \/ quadSegs;   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v519\/\">V519<\/a> The &#8216;filletAngleQuantum&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 82, 86. OffsetSegmentGenerator.cpp 86<\/p>\n<p> <\/p>\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043a\u043e\u0434:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">filletAngleQuantum = MATH_PI \/ 2.0 \/ bufParams.getQuadrantSegments();<\/code><\/pre>\n<p> <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>getQuadrantSegments<\/code> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c 0, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043d\u043e\u043b\u044c:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">int quadSegs = bufParams.getQuadrantSegments(); if (quadSegs &lt; 1) quadSegs = 1; filletAngleQuantum = MATH_PI \/ 2.0 \/ quadSegs;<\/code><\/pre>\n<p> <\/p>\n<p>\u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0437\u0430\u0431\u044b\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432 \u043d\u0435\u0439 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u043e\u043b\u044c \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p> <\/p>\n<h3 id=\"oshibka-n164-odinakovye-funkcii\">\u041e\u0448\u0438\u0431\u043a\u0430 N164. \u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">typedef struct {   int64_t firstVer;   int64_t lastVer;   int64_t createTs;   int64_t closeTs;   int64_t fileSize;   int64_t syncedOffset; } SWalFileInfo;  static inline int64_t walGetCurFileFirstVer(SWal* pWal) {   if (pWal-&gt;writeCur == -1) return -1;   SWalFileInfo* pInfo =     (SWalFileInfo*)taosArrayGet(pWal-&gt;fileInfoSet, pWal-&gt;writeCur);   return pInfo-&gt;firstVer; }  static inline int64_t walGetCurFileLastVer(SWal* pWal) {   if (pWal-&gt;writeCur == -1) return -1;   SWalFileInfo* pInfo =     (SWalFileInfo*)taosArrayGet(pWal-&gt;fileInfoSet, pWal-&gt;writeCur);   return pInfo-&gt;firstVer; }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v524\/\">V524<\/a> It is odd that the body of &#8216;walGetCurFileLastVer&#8217; function is fully equivalent to the body of &#8216;walGetCurFileFirstVer&#8217; function. walInt.h 97<\/p>\n<p> <\/p>\n<p>\u0412 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 <code>SWalFileInfo<\/code> \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u043b\u044f:<\/p>\n<p> <\/p>\n<ul>\n<li><strong>first<\/strong>Ver;<\/li>\n<li><strong>last<\/strong>Ver.<\/li>\n<\/ul>\n<p> <\/p>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u043e\u043b\u0435\u0439:<\/p>\n<p> <\/p>\n<ul>\n<li>walGetCurFile<strong>First<\/strong>Ver;<\/li>\n<li>walGetCurFile<strong>Last<\/strong>Ver.<\/li>\n<\/ul>\n<p> <\/p>\n<p>\u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b, \u0438 \u043e\u0431\u0435 \u043e\u043d\u0438 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f <code>firstVer<\/code>.<\/p>\n<p> <\/p>\n<h3 id=\"oshibki-n165n170-proklyatie-skobochek\">\u041e\u0448\u0438\u0431\u043a\u0438 N165\u2013N170. &#171;\u041f\u0440\u043e\u043a\u043b\u044f\u0442\u0438\u0435 \u0441\u043a\u043e\u0431\u043e\u0447\u0435\u043a&#187;<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">int32_t dmInit() {   dInfo(\"start to init dnode env\");   int32_t code = 0;   ....   if ((code = dmCheckDiskSpace()) != 0) return code;   if ((code = dmCheckRepeatInit(dmInstance())) != 0) return code;   if ((code = dmInitSystem()) != 0) return code;   if ((code = dmInitMonitor()) != 0) return code;   if ((code = dmInitAudit()) != 0) return code;   if ((code = dmInitDnode(dmInstance())) != 0) return code;   if ((code = InitRegexCache() != 0)) return code;   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v593\/\">V593<\/a> Consider reviewing the expression of the &#8216;A = B != C&#8217; kind. The expression is calculated as following: &#8216;A = (B != C)&#8217;. dmEnv.c 182<\/p>\n<p> <\/p>\n<p>\u041a\u0442\u043e \u0432\u0438\u0434\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0443? \ud83d\ude09<\/p>\n<p> <\/p>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0441\u043a\u043e\u0431\u043e\u0447\u043a\u0430 \u043d\u0435 \u0442\u0430\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>InitRegexCache<\/code> \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 0, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0442\u0435\u043c 0 \u0438\u043b\u0438 1 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>code<\/code>.<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a:<\/p>\n<p> <\/p>\n<ol>\n<li>V593 Consider reviewing the expression of the &#8216;A = B != C&#8217; kind. The expression is calculated as following: &#8216;A = (B != C)&#8217;. mndArbGroup.c 299<\/li>\n<li>V593 Consider reviewing the expression of the &#8216;A = B != C&#8217; kind. The expression is calculated as following: &#8216;A = (B != C)&#8217;. mndConfig.c 430<\/li>\n<li>V593 Consider reviewing the expression of the &#8216;A = B != C&#8217; kind. The expression is calculated as following: &#8216;A = (B != C)&#8217;. mndUser.c 418<\/li>\n<li>V593 Consider reviewing the expression of the &#8216;A = B &lt; C&#8217; kind. The expression is calculated as following: &#8216;A = (B &lt; C)&#8217;. streamMeta.c 411<\/li>\n<li>V593 Consider reviewing the expression of the &#8216;A = B != C&#8217; kind. The expression is calculated as following: &#8216;A = (B != C)&#8217;. transCli.c 1876<\/li>\n<\/ol>\n<p> <\/p>\n<h3 id=\"oshibka-n171-bessmyslennaya-proverka\">\u041e\u0448\u0438\u0431\u043a\u0430 N171. \u0411\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">void CoordinateSequence::add(const CoordinateSequence&amp; cs,                         std::size_t from, std::size_t to) {   if (cs.stride() == stride() &amp;&amp; cs.hasM() == cs.hasM()) {       m_vect.insert(m_vect.end(),                     std::next(cs.m_vect.cbegin(),                     static_cast&lt;std::ptrdiff_t&gt;(from * stride())),                     std::next(cs.m_vect.cbegin(),                     static_cast&lt;std::ptrdiff_t&gt;((to + 1u)*stride())));   } else {   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v501\/\">V501<\/a> There are identical sub-expressions to the left and to the right of the &#8216;==&#8217; operator: cs.hasM() == cs.hasM() CoordinateSequence.cpp 154<\/p>\n<p> <\/p>\n<p>\u0420\u0443\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0434\u0440\u043e\u0433\u043d\u0443\u043b\u0430, \u0438 \u043e\u043d \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0434\u043e\u043f\u0438\u0441\u0430\u043b \u043b\u0438\u0448\u043d\u0438\u0439 <code>cs.<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0439:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">cs.hasM() == cs.hasM()<\/code><\/pre>\n<p> <\/p>\n<h3 id=\"oshibka-n172-ne-oshibka-no-oshibka\">\u041e\u0448\u0438\u0431\u043a\u0430 N172. \u041d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0430<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">bool startsWith(const std::string &amp; s, char prefix) {   if (s.empty() == 0) {     return false;   }    return s[0] == prefix; }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v557\/\">V557<\/a> Array overrun is possible. The &#8216;0&#8217; index is pointing beyond array bound. string.cpp 53<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0434\u0430\u0447\u043d\u043e\u0435. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0435\u0442. \u0414\u0430\u0436\u0435 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0441\u0438\u043c\u0432\u043e\u043b (\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043b\u044c). \u041e\u0434\u043d\u0430\u043a\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0445\u043e\u0447\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0443\u0441\u0442\u0430\u044f, \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u043a \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. \u042d\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u0438, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430, \u043a\u0430\u043a \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p> <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 N1<\/strong>. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f. \u041f\u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c.<\/p>\n<p> <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 N2<\/strong>. \u0414\u043e C++11 \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/string\/basic_string\/operator_at\">\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442<\/a> \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p> <\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>empty<\/code> \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442 \u0441 0. \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u044f\u0432\u043d\u043e \u043b\u0438\u0448\u043d\u0435\u0435, \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">bool startsWith(const std::string &amp; s, char prefix) {   if (s.empty()) {     return false;   }    return s[0] == prefix; }<\/code><\/pre>\n<p> <\/p>\n<h3 id=\"oshibka-n173-opechatka-pri-ispolzovanii-shozhih-imyon-peremennyh\">\u041e\u0448\u0438\u0431\u043a\u0430 N173. \u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0445\u043e\u0436\u0438\u0445 \u0438\u043c\u0451\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">int32_t streamTaskUpdateTaskCheckpointInfo(....) {   ....   bool valid = (pInfo-&gt;checkpointId  &lt;= pReq-&gt;checkpointId &amp;&amp;                 pInfo-&gt;checkpointVer &lt;= pReq-&gt;checkpointVer &amp;&amp;                 pInfo-&gt;processedVer  &lt;= pReq-&gt;checkpointVer);   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1013\/\">V1013<\/a> Suspicious subexpression in a sequence of similar comparisons. streamCheckpoint.c 654<\/p>\n<p> <\/p>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0441\u0445\u043e\u0436\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435\u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443.<\/p>\n<p> <\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>pInfo-&gt;processedVer<\/code> \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0441 <code>pReq-&gt;checkpointVer<\/code>, \u0430 \u0441 <code>pReq-&gt;processedVer<\/code>.<\/p>\n<p> <\/p>\n<h3 id=\"oshibki-n174-i-n175-kolbasa-i-plata-za-len\">\u041e\u0448\u0438\u0431\u043a\u0438 N174 \u0438 N175. \u041a\u043e\u043b\u0431\u0430\u0441\u0430 \u0438 \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u043b\u0435\u043d\u044c<\/h3>\n<p> <\/p>\n<p>\u0415\u0449\u0451 \u0434\u0432\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u044f \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u044b\u0445 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0443 \u043d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<p> <\/p>\n<ol>\n<li>\u0423\u0447\u0438\u043c\u0441\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0430\u0433\u043e\u0432 \u0432 TDengine, \u0447\u0430\u0441\u0442\u044c 1: <a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/888060\/\">\u043f\u0440\u043e \u043a\u043e\u043b\u0431\u0430\u0441\u0443<\/a>.<\/li>\n<li>\u0423\u0447\u0438\u043c\u0441\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0430\u0433\u043e\u0432 \u0432 TDengine, \u0447\u0430\u0441\u0442\u044c 3: <a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/895978\/\">\u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u043b\u0435\u043d\u044c<\/a>.<\/li>\n<\/ol>\n<p> <\/p>\n<h2 id=\"drugie-oshibki\">\u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h2>\n<p> <\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043a\u0430\u043a \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u043f\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c. \u042f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0432\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0438, \u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044e:<\/p>\n<p> <\/p>\n<ol>\n<li>\u042f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043e\u0442\u0447\u0451\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e \u0438 \u0432\u044b\u043f\u0438\u0441\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a. \u041c\u043e\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430, \u0430 \u043d\u0435 \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a.<\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/articles\/436868\/\">\u0421\u0443\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u0430 \u043d\u0435 \u0432 \u0440\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0445<\/a>.<\/li>\n<\/ol>\n<p> <\/p>\n<p>\u041f\u043e\u0434 \u043a\u043e\u043d\u0435\u0446 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0435 \u0432\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0433\u043b\u0430\u0432\u044b. <\/p>\n<p> <\/p>\n<h3 id=\"oshibki-n176-i-n177-oshibki-ispolzovaniya-operatora-sdviga-\">\u041e\u0448\u0438\u0431\u043a\u0438 N176 \u0438 N177. \u041e\u0448\u0438\u0431\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441\u0434\u0432\u0438\u0433\u0430 &lt;&lt;<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">uint64_t unpackUint64(uint8_t* ch, uint8_t sz) {   uint64_t n = 0;   for (uint8_t i = 0; i &lt; sz; i++) {     n = n | (ch[i] &lt;&lt; (8 * i));   }   return n; }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v629\/\">V629<\/a> Consider inspecting the &#8216;ch[i] &lt;&lt; (8 * i)&#8217; expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type. indexFstUtil.c 55<\/p>\n<p> <\/p>\n<p>\u0418\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0430\u0439\u0442 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043e 64-\u0431\u0438\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u0431\u043e\u0439 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u0448\u0438\u0435 32-\u0431\u0438\u0442\u0430 \u0432 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u041f\u0440\u0438 \u0441\u0434\u0432\u0438\u0433\u0435 \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f 8-\u0431\u0438\u0442\u043d\u044b\u043c \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c, \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d \u0432 32-\u0431\u0438\u0442\u043d\u044b\u0439 <code>int<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e: \u043f\u0440\u0438 \u0441\u0434\u0432\u0438\u0433\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>int<\/code> \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c 31 \u0440\u0430\u0437\u0440\u044f\u0434 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a 64-\u0431\u0438\u0442\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">n = n | ((uint64_t)(ch[i]) &lt;&lt; (8 * i));<\/code><\/pre>\n<p> <\/p>\n<p>\u0421\u0445\u043e\u0436\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">static int hashset_add(hashset_t set, void *item) {   int ret = hashset_add_member(set, item);    size_t old_capacity = set-&gt;capacity;   if (set-&gt;nitems &gt;= (double)old_capacity * set-&gt;load_factor) {     size_t *old_items = set-&gt;items;     ++set-&gt;nbits;     set-&gt;capacity = (size_t)(1 &lt;&lt; set-&gt;nbits);   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio \u0434\u0440\u0443\u0433\u043e\u0435: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1028\/\">V1028<\/a> Possible overflow. Consider casting operands of the &#8216;1 &lt;&lt; set-&gt;nbits&#8217; operator to the &#8216;size_t&#8217; type, not the result. tdbPager.c 88<\/p>\n<p> <\/p>\n<h3 id=\"oshibka-n178-nedostizhimyy-kod\">\u041e\u0448\u0438\u0431\u043a\u0430 N178. \u041d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0439 \u043a\u043e\u0434<\/h3>\n<p> <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">static int32_t getBlkFromSessionCache(struct SOperatorInfo* pOperator,   int64_t sessionId, SGcSessionCtx* pSession, SSDataBlock** ppRes) {   int32_t code = TSDB_CODE_SUCCESS;   SGroupCacheOperatorInfo* pGCache = pOperator-&gt;info;   bool locked = false;   SGcDownstreamCtx* pCtx = &amp;pGCache-&gt;pDownstreams[pSession-&gt;downstreamIdx];    while (true) {     bool got = false;     code = getBlkFromSessionCacheImpl(pOperator, sessionId,                                       pSession, ppRes, &amp;got);     if (TSDB_CODE_SUCCESS != code || got) {       goto _return;     }      if ((atomic_load_64(&amp;pCtx-&gt;fetchSessionId) == sessionId)       || (-1 == atomic_val_compare_exchange_64(                   &amp;pCtx-&gt;fetchSessionId, -1, sessionId))) {       if (locked) {         (void)taosThreadMutexUnlock(&amp;pSession-&gt;pGroupData-&gt;mutex);         locked = false;       }        code = getCacheBlkFromDownstreamOperator(pOperator, pCtx,                                                sessionId, pSession, ppRes);       goto _return;     } else {       \/\/ FOR NOW, SHOULD NOT REACH HERE       qError(\"Invalid fetchSessionId:%\" PRId64 \",              currentSessionId:%\" PRId64, pCtx-&gt;fetchSessionId, sessionId);       return TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;     }      if (locked) {       code = groupCacheSessionWait(pOperator, pCtx, sessionId,                                    pSession, ppRes);       locked = false;       if (TSDB_CODE_SUCCESS != code) {         goto _return;       }        break;     }      (void)taosThreadMutexLock(&amp;pSession-&gt;pGroupData-&gt;mutex);     locked = true;   };  _return:    if (locked) {     (void)taosThreadMutexUnlock(&amp;pSession-&gt;pGroupData-&gt;mutex);   }    return code; }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v779\/\">V779<\/a> Unreachable code detected. It is possible that an error is present. groupcacheoperator.c 1227<\/p>\n<p> <\/p>\n<p>\u0423\u0434\u0430\u043b\u043e\u0441\u044c? \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0432\u043e\u0442 \u0433\u0434\u0435 \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">if (....)        \/\/ &lt;&lt; (A) {   ....   goto _return;  \/\/ &lt;&lt; (B) } else {   ....   return TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR; \/\/ &lt;&lt; (C) } .... if (locked) {    \/\/ &lt;&lt; (D) .... _return:         \/\/ &lt;&lt; (E)<\/code><\/pre>\n<p> <\/p>\n<p>\u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f (A), \u043a\u043e\u0434 (D) \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. \u041f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 (B) \u043a \u043c\u0435\u0442\u043a\u0435 (E), \u0438\u043b\u0438 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00a9.<\/p>\n<p> <\/p>\n<h3 id=\"oshibki-n179n184-potencialnoe-perepolnenie\">\u041e\u0448\u0438\u0431\u043a\u0438 N179\u2013N184. \u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">typedef struct SFilePage {   int32_t num;   .... } SFilePage;  typedef struct tMemBucket {   ....   int32_t            bytes;   .... } tMemBucket;  static int32_t loadDataFromFilePage(tMemBucket *pMemBucket, ....) {   ....   SFilePage *pg = getBufPage(pMemBucket-&gt;pBuffer, *pageId);   ....   (void)memcpy((*buffer)-&gt;data + offset, pg-&gt;data,                (size_t)(pg-&gt;num * pMemBucket-&gt;bytes));   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1028\/\">V1028<\/a> Possible overflow. Consider casting operands of the &#8216;pg-&gt;num * pMemBucket-&gt;bytes&#8217; operator to the &#8216;size_t&#8217; type, not the result. tpercentile.c 64<\/p>\n<p> <\/p>\n<p>\u042f\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0438 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">(size_t)(pg-&gt;num * pMemBucket-&gt;bytes)<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u043e, \u0430 \u043d\u0435 \u043f\u043e\u0441\u043b\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p> <\/p>\n<pre><code class=\"cpp\">(size_t)(pg-&gt;num) * pMemBucket-&gt;bytes<\/code><\/pre>\n<p> <\/p>\n<p>\u0421\u0445\u043e\u0436\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<p> <\/p>\n<ol>\n<li>V1028 Possible overflow. Consider casting operands of the &#8216;pColData-&gt;nVal + 1&#8217; operator to the &#8216;int64_t&#8217; type, not the result. tdataformat.c 1904<\/li>\n<li>V1028 Possible overflow. Consider casting operands of the &#8216;pColData-&gt;nVal + 1&#8217; operator to the &#8216;int64_t&#8217; type, not the result. tdataformat.c 1904<\/li>\n<li>V1028 Possible overflow. Consider casting operands, not the result. compaction_picker_level.cc 818<\/li>\n<li>V1028 Possible overflow. Consider casting operands of the &#8216;vlen * 4&#8217; operator to the &#8216;size_t&#8217; type, not the result. tbase64.c 23<\/li>\n<li>V1028 Possible overflow. Consider casting operands of the &#8216;inlen * 3&#8217; operator to the &#8216;size_t&#8217; type, not the result. tbase64.c 59<\/li>\n<\/ol>\n<p> <\/p>\n<h3 id=\"oshibka-n185-nedopustimoe-rasshirenie-prostranstva-imyon-std\">\u041e\u0448\u0438\u0431\u043a\u0430 N185. \u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d std<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">namespace std { inline void swap(ROCKSDB_NAMESPACE::port::WindowsThread&amp; th1,                  ROCKSDB_NAMESPACE::port::WindowsThread&amp; th2) {   th1.swap(th2); } }  \/\/ namespace std<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1061\/\">V1061<\/a> Extending the &#8216;std&#8217; namespace may result in undefined behavior. win_thread.h 110<\/p>\n<p> <\/p>\n<p>\u0421 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0444\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0430 \u044f \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u0431\u0430\u0433\u0438 \ud83d\ude42 \u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043e\u0439\u0434\u0443 \u0434\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 190 \u0431\u0430\u0433\u043e\u0432 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c. \u0418\u043b\u0438 \u0434\u043e 200 \u0434\u043e\u0439\u0442\u0438? \u041d\u0435\u0442, \u0434\u043e\u043b\u043e\u0439 \u043f\u0435\u0440\u0444\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0437\u043c, \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u043e\u0445\u043d\u0443\u0442\u044c.<\/p>\n<p> <\/p>\n<h3 id=\"oshibka-n186-sravnenie-musornyh-baytov\">\u041e\u0448\u0438\u0431\u043a\u0430 N186. \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 &#171;\u043c\u0443\u0441\u043e\u0440\u043d\u044b\u0445&#187; \u0431\u0430\u0439\u0442\u043e\u0432<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">typedef struct STreeNode {   int32_t index;   void   *pData;  \/\/ TODO remove it? } STreeNode;  int32_t tMergeTreeAdjust(SMultiwayMergeTreeInfo* pTree, int32_t idx) {   ....   STreeNode kLeaf = pTree-&gt;pNode[idx];   ....   if (memcmp(&amp;kLeaf, &amp;pTree-&gt;pNode[1], sizeof(kLeaf)) != 0) {   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1103\/\">V1103<\/a> The values of padding bytes are unspecified. Comparing objects with padding using &#8216;memcmp&#8217; may lead to unexpected result. tlosertree.c 127<\/p>\n<p> <\/p>\n<p>\u0412 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>index<\/code> \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f 4 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0430\u0439\u0442\u0430, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0440\u043e\u0432\u043d\u044f\u0442\u044c 64-\u0431\u0438\u0442\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0435 8 \u0431\u0430\u0439\u0442. \u041f\u043b\u043e\u0445\u0430\u044f \u0438\u0434\u0435\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>memcmp<\/code>. \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0430\u0439\u0442\u0430\u0445 \u0434\u043b\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u043b\u0435\u0436\u0430\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>memcmp<\/code> \u043c\u043e\u0436\u0435\u0442 \u0441\u0447\u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0435\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438, \u0445\u043e\u0442\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442.<\/p>\n<p> <\/p>\n<h3 id=\"oshibki-n187-n190-ispolzovanie-ustarevshih-funkciy-svyazannyh-s-kriptografiey\">\u041e\u0448\u0438\u0431\u043a\u0438 N187-N190. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0435\u0439<\/h3>\n<p> <\/p>\n<pre><code class=\"cpp\">uint32_t taosSafeRand(void) {   ....   if (!CryptGenRandom(hCryptProv, 4, &amp;seed)) return seed;   .... }<\/code><\/pre>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1109\/\">V1109<\/a> The &#8216;CryptGenRandom&#8217; function is deprecated. Consider switching to an equivalent newer function. osRand.c 56<\/p>\n<p> <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u0441\u0445\u043e\u0436\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<p> <\/p>\n<ol>\n<li>V1109 The &#8216;CryptAcquireContextA&#8217; function is deprecated. Consider switching to an equivalent newer function. osRand.c 50<\/li>\n<li>V1109 The &#8216;CryptAcquireContextA&#8217; function is deprecated. Consider switching to an equivalent newer function. osRand.c 51<\/li>\n<li>V1109 The &#8216;CryptReleaseContext&#8217; function is deprecated. Consider switching to an equivalent newer function. osRand.c 58<\/li>\n<\/ol>\n<p> <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p> <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, \u0447\u0442\u043e\u0431\u044b:<\/p>\n<p> <\/p>\n<ol>\n<li>\u041f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0440\u0438\u0441\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0434\u043d\u044f \u0432 \u0432\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445.<\/li>\n<li>\u041d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0435\u0449\u0451 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438: \u0447\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435 \u0434\u0435\u0444\u0435\u043a\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d, \u0442\u0435\u043c \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/li>\n<li>\u0412\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043e\u0448\u0438\u0431\u043e\u043a, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u0442\u044c.<\/li>\n<li>\u0421\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0431\u0437\u043e\u0440\u0430\u0445 \u043a\u043e\u0434\u0430 (code review) \u043d\u0430\u0434 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u0430 \u043d\u0435 \u0432\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u043c\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0431\u043e\u043a.<\/li>\n<li>\u041f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043a\u043e\u0434. \u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0434\u0430\u0436\u0435 \u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430. \u0415\u0441\u043b\u0438 \u043a\u043e\u0434 \u0437\u0430\u043f\u0443\u0442\u0430\u043b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u0442\u043e \u043e\u043d \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043b\u0443\u0447\u0448\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c.<\/li>\n<li>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u043e\u0441\u0442 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043b\u043b\u0435\u0433.<\/li>\n<li>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f (\u0420\u0411\u041f\u041e\/SSDLC).<\/li>\n<\/ol>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e \u0420\u0411\u041f\u041e \u043f\u043e \u0413\u041e\u0421\u0422 \u0420 56939-2024, \u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u0413\u041e\u0421\u0422 \u0420 71207\u20132024 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0432 \u0441\u0435\u0431\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p> <\/p>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/\">PVS-Studio<\/a>. \u041e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0430\u0445 C, C++, C#, Java. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c Windows, Linux, ma\u0441OS. \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/sast\/\">SAST \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c<\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e, \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p> <\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0420\u043e\u0441\u0441\u0438\u0438 \u0441 2008 \u0433\u043e\u0434\u0430 (\u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0415\u0434\u0438\u043d\u043e\u043c \u0420\u0435\u0435\u0441\u0442\u0440\u0435 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u041f\u041e N9837) \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 1000 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435. \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u0413\u041e\u0421\u0422 \u0420 71207-2024 (\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441 \u043d\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432 (\u0424\u0421\u0422\u042d\u041a).<\/p>\n<p> <\/p>\n<h2 id=\"dopolnitelnye-ssylki\">\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p> <\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/844070\/\">\u0413\u041e\u0421\u0422 \u0420 71207\u20132024 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u043a\u043e\u0434\u0430<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0873\/\">\u0420\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u0421++ \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432: \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043a\u043e\u0434\u0430<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1115\/\">\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/1046\/\">5 \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430 \u0432\u0430\u0436\u0435\u043d \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0779\/\">\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u043d\u0435 \u043f\u0440\u0430\u0432, \u0434\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/0743\/\">\u041a\u0430\u043a \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u0432 legacy \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043d\u0435 \u0434\u0435\u043c\u043e\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/a>.<\/li>\n<\/ol>\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:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/1249\/\">Why SSDLC needs static analysis: a case study of 190 bugs in TDengine<\/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\/907674\/\"> https:\/\/habr.com\/ru\/articles\/907674\/<\/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><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ko\/ki\/au\/kokiaukueeqlsppeutf4kqg4t30.png\" alt=\"\u0420\u0411\u041f\u041e\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/ko\/ki\/au\/kokiaukueeqlsppeutf4kqg4t30.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/ko\/ki\/au\/kokiaukueeqlsppeutf4kqg4t30.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0430\u0436\u043d\u0435\u0439\u0448\u0438\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 \u0440\u0430\u043d\u043d\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e, \u0447\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0445 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041d\u043e \u0447\u0442\u043e \u0435\u0449\u0451 \u0432\u0430\u0436\u043d\u0435\u0435, \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u0442\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u0434\u0435\u0444\u0435\u043a\u0442\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0442.<\/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-458917","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/458917","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=458917"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/458917\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=458917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=458917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=458917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}