{"id":328911,"date":"2022-02-01T15:00:13","date_gmt":"2022-02-01T15:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=328911"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=328911","title":{"rendered":"<span>MuditaOS: \u0437\u0430\u0437\u0432\u043e\u043d\u0438\u0442 \u043b\u0438 \u0432\u0430\u0448 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a? \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2013 \u044d\u0442\u043e \u0442\u043e\u0442 \u0432\u0438\u0434 \u0441\u043e\u0444\u0442\u0430, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u043f\u043e\u043f\u0430\u043b\u0430 MuditaOS. \u0422\u0430\u043a \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d42\/77d\/346\/d4277d3466f538d01bdce5879039eb5d.png\" data-width=\"780\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p><a href=\"https:\/\/mudita.com\/\">MuditaOS<\/a> \u2013 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 FreeRTOS (<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0684\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435). \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 Mudita, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0438 \u0438 \u0447\u0430\u0441\u044b. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u044f\u0437\u044b\u043a\u0430\u0445 \u0421 \u0438 \u0421++. \u041d\u0443 \u0447\u0442\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442? \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0438 \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0438? \ud83d\ude42<\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u043f\u043e\u0434 Ubuntu 20.04 \u043f\u043e <a href=\"https:\/\/github.com\/mudita\/MuditaOS\/blob\/master\/doc\/quickstart.md\">\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/a> \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0430\u0441\u044c \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043b\u044f \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 Mudita Bell. \u041f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u043a\u043e\u043d\u0435\u0446 2021 \u0433\u043e\u0434\u0430, \u043e\u043d \u0441\u0442\u043e\u0438\u0442 <em>60$<\/em> \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"316\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c50\/405\/909\/c504059098bd34353483e50b881d4c94.png\" data-width=\"580\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044f \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0435\u0439 <a href=\"https:\/\/github.com\/mudita\/MuditaOS\/tree\/8cc1f779db7824a665240c5a89f1590a5831502c\">8cc1f77<\/a>.<\/p>\n<h3>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/h3>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N1-N3<\/h4>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c, \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u0434\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0441 \u043b\u0435\u043a\u0446\u0438\u0435\u0439 \u0432 \u0422\u0443\u043b\u0413\u0423 \u043f\u0440\u043e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0422\u0430\u043c, \u0432 \u0441\u043b\u0430\u0439\u0434\u0435 <em>\u043e \u0441\u0435\u0431\u0435<\/em>, \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0441\u044f \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"331\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b1\/faf\/e4b\/5b1fafe4b2e60cc5b1dad55572a0895e.png\" data-width=\"580\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c: \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435 PVS-Studio \u043e\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430 \u2013 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e. \u0412 \u043d\u0451\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u0443\u0437\u043b\u043e\u0432 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0437\u043b\u0430\u043c\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u0430\u0441\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 PVS-Studio \u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432\u0430\u043b\u0438\u043b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 (\u043f\u0440\u0438 \u043f\u0440\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0445), \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044f \u0431\u0435\u0437 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439 \u0437\u043d\u0430\u044e \u0442\u043e\u0447\u043d\u044b\u0439 \u0442\u0438\u043f \u0443\u0437\u043b\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e \u0443\u0437\u0435\u043b \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0434\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 MuditaOS \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u044f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0442\u0438\u043f\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v595\/\">V595<\/a> [CERT-EXP12-C] The &#8216;result&#8217; pointer was utilized before it was verified against nullptr. Check lines: 81, 82. AudioModel.cpp 81<\/p>\n<pre><code class=\"cpp\">void AudioModel::play(....) {   ....   auto cb = [_callback = callback, this](auto response)              {               auto result = dynamic_cast                             &lt;service::AudioStartPlaybackResponse *>(response);               lastPlayedToken = result->token;               if (result == nullptr)                {                 ....               }               ....             };   .... } <\/code><\/pre>\n<p>\u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0422\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>dynamic_cast<\/em>. \u041f\u043e\u0442\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u2014 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0437\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>nullptr<\/em>.<\/p>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <em>result<\/em> \u043f\u0435\u0440\u0435\u0434 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v757\/\">V757<\/a> [CERT-EXP12-C] It is possible that an incorrect variable is compared with nullptr after type conversion using &#8216;dynamic_cast&#8217;. Check lines: 214, 214. CallLogDetailsWindow.cpp 214<\/p>\n<pre><code class=\"cpp\">void CallLogDetailsWindow::onBeforeShow(...., SwitchData *data) {   ....   if (auto switchData = dynamic_cast                         &lt;calllog::CallLogSwitchData *>(data); data != nullptr)    {     ....   }   .... } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>dynamic_cast<\/em>. \u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>nullptr<\/em>, \u0445\u043e\u0442\u044f, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 <em>nullptr<\/em> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">void CallLogDetailsWindow::onBeforeShow(...., SwitchData *data) {   ....   if (auto switchData = dynamic_cast&lt;calllog::CallLogSwitchData *>(data))    {     ....   }   .... } <\/code><\/pre>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0435 \u0432\u0441\u0435\u043c \u043f\u043e \u0434\u0443\u0448\u0435, \u043d\u043e \u043c\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c \u2013 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0438 \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u043e\u0434\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u2014 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432\u0435\u0437\u0434\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u043b\u043e\u0445:<\/p>\n<pre><code class=\"cpp\">int x = ...; if (x = foo()) <\/code><\/pre>\n<p>\u041d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0445\u043e\u0442\u0435\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u0430\u043b\u0438\u0441\u044c, \u0438\u043b\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0441 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v559\/\">\u0440\u0443\u0433\u0430\u044e\u0442\u0441\u044f<\/a> \u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u0440\u0430\u0432\u044b. \u041a\u043e\u0434 \u043e\u043f\u0430\u0441\u0435\u043d \u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u0435\u043d. \u0414\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u0430\u043a \u0432 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0412 \u043d\u0451\u043c \u044f\u0432\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c. \u0410 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c == \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438.<\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043a\u043e\u0434\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412\u043e\u0442 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v757\/\">V757<\/a> [CERT-EXP12-C] It is possible that an incorrect variable is compared with nullptr after type conversion using &#8216;dynamic_cast&#8217;. Check lines: 47, 47. PhoneNameWindow.cpp 47<\/p>\n<pre><code class=\"cpp\">void PhoneNameWindow::onBeforeShow(ShowMode \/*mode*\/, SwitchData *data) {   if (const auto newData = dynamic_cast&lt;PhoneNameData *>(data);                                                              data != nullptr)    {     ....   } } <\/code><\/pre>\n<p>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">void PhoneNameWindow::onBeforeShow(ShowMode \/*mode*\/, SwitchData *data) {   if (const auto newData = dynamic_cast&lt;PhoneNameData *>(data))    {     ....   } } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u2013 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0443 \u043a\u043e\u0434\u0430 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/video\/10512\/\">\u0432\u0438\u0434\u0435\u043e<\/a>. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b \u2013 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c. \u041e\u043d\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0438 \u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \ud83d\ude42<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N4<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v522\/\">V522<\/a> [CERT-EXP34-C] Dereferencing of the null pointer &#8216;document&#8217; might take place. TextBlockCursor.cpp 332<\/p>\n<pre><code class=\"cpp\">auto BlockCursor::begin() -> std::list&lt;TextBlock>::iterator {   return document == nullptr              ? document->blocks.end() : document->blocks.begin(); } <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0435\u0439\u0441\u043f\u0430\u043b\u043c\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442: \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u044f\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <em>document<\/em> \u043d\u0430 <em>nullptr<\/em> \u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043e\u0431\u043e\u0438\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0446\u0435\u043b\u044c\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0431\u044b\u043b\u043e \u0443\u0440\u043e\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N5<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v517\/\">V517<\/a> [CERT-MSC01-C] 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: 1053, 1056. avdtp_util.c 1053<\/p>\n<pre><code class=\"cpp\">static uint16_t avdtp_signaling_setup_media_codec_mpeg_audio_config_event(....) {   uint8_t channel_mode_bitmap = ....;   ....   if (....)   {     ....   }   else if (channel_mode_bitmap &amp; 0x02)   {     num_channels = 2;     channel_mode = AVDTP_CHANNEL_MODE_STEREO;   }   else if (channel_mode_bitmap &amp; 0x02)   {     num_channels = 2;     channel_mode = AVDTP_CHANNEL_MODE_JOINT_STEREO;   }   .... } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430: \u043b\u0438\u0431\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043b\u0438\u0431\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430 \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430. \u0421\u0443\u0434\u044f \u043f\u043e \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u0434\u0432\u0443\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0451 \u0436\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c MuditaOS \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N6, N7<\/h4>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v571\/\">V571<\/a> Recurring check. The &#8216;if (activeInput)&#8217; condition was already verified in line 249. ServiceAudio.cpp 250<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;activeInput&#8217; is always true. ServiceAudio.cpp 250<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">std::optional&lt;AudioMux::Input *> AudioMux::GetActiveInput();  ....  auto Audio::handleSetVolume(....) -> std::unique_ptr&lt;AudioResponseMessage> {   ....   if (const auto activeInput = audioMux.GetActiveInput(); activeInput)    {     if (activeInput)      {       retCode = activeInput.value()->audio->SetOutputVolume(clampedValue);     }   }   .... } <\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u043c\u0438\u043d\u0438-\u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u0422\u0438\u043f <em>activeInput<\/em> &#8212; <em>std::optional<\/em> \u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 <em>AudioMux::Input<\/em>. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 \u043f\u043e\u0434 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c <em>if<\/em>, \u0442\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d <em>value.<\/em> \u041e\u043d\u0430 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0430\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 \u0431\u0440\u043e\u0441\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e* *\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u0430\u043a \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439, \u0442\u0430\u043a \u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c <em>if<\/em>. \u041c\u043c\u043c, \u044f \u0442\u043e\u0436\u0435 \u043b\u044e\u0431\u043b\u044e \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0438 \u0431\u0443\u043b\u0435\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 <em>std::optional<\/em>! \u0418 \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0431\u043b\u0438 \ud83d\ude42<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"500\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c6a\/1e0\/03b\/c6a1e003bb46b526967707e0eafd448b.png\" data-width=\"580\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">std::optional&lt;AudioMux::Input *> AudioMux::GetActiveInput();  ....  auto Audio::handleSetVolume(....) -> std::unique_ptr&lt;AudioResponseMessage> {   ....   if (const auto activeInput = audioMux.GetActiveInput(); activeInput)    {     if (*activeInput)      {       retCode = (*activeInput)->audio->SetOutputVolume(clampedValue);     }   }   .... } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N8-N11<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v668\/\">V668<\/a> [CERT-MEM52-CPP] There is no sense in testing the &#8216;pcBuffer&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. syscalls_stdio.cpp 384<\/p>\n<pre><code class=\"cpp\">int _iosys_fprintf(FILE *__restrict __stream,                    const char *__restrict __format, ...) {   constexpr auto buf_len = 4096;   char *pcBuffer;   ....   pcBuffer = new char[buf_len];   if (pcBuffer == NULL)    {     ....   } } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <em>new (\u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043c\u043e\u0433\u0443 \u0441\u0443\u0434\u0438\u0442\u044c \u043f\u043e \u043a\u043e\u0434\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d),<\/em> \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 <em>NULL<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>new<\/em> \u043d\u0435 \u0441\u043c\u043e\u0433 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0442\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u044f\u0437\u044b\u043a\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>std::bad_alloc()<\/em>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u044e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/memory\/new\/nothrow\"><em>nothrow<\/em><\/a> \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 <em>new<\/em>:<\/p>\n<pre><code class=\"cpp\">int _iosys_fprintf(FILE *__restrict __stream,                    const char *__restrict __format, ...) {   constexpr auto buf_len = 4096;   char *pcBuffer;   ....   pcBuffer = new (std::nothrow) char[buf_len];   if (pcBuffer == NULL)    {     ....   } } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v668\/\">V668<\/a> [CERT-MEM52-CPP] There is no sense in testing the &#8216;fontData&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. FontManager.cpp 56<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v668\/\">V668<\/a> [CERT-MEM52-CPP] There is no sense in testing the &#8216;data&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. ImageManager.cpp 85<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v668\/\">V668<\/a> [CERT-MEM52-CPP] There is no sense in testing the &#8216;data&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. ImageManager.cpp 131<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N12<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v509\/\">V509<\/a> [CERT-DCL57-CPP] The noexcept function &#8216;=&#8217; calls function &#8216;setName&#8217; which can potentially throw an exception. Consider wrapping it in a try..catch block. Device.cpp 48<\/p>\n<pre><code class=\"cpp\">struct Device {   static constexpr auto NameBufferSize = 240;   ....   void setName(const std::string &amp;name)   {     if (name.size() > NameBufferSize)      {         throw std::runtime_error(\"Requested name is bigger than buffer                                    size\");     }     strcpy(this->name.data(), name.c_str());   }   .... }  ....  Devicei &amp;Devicei::operator=(Devicei &amp;&amp;d) noexcept {   setName(d.name.data()); } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u043a <em>noexcept<\/em>, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0431\u0440\u043e\u0441\u0430\u044e\u0449\u0430\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0442\u0435\u043b\u0430 nothrow-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f <em>std::terminate<\/em>, \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <em>setName<\/em> \u0432 function-try \u0431\u043b\u043e\u043a \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0443\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0438\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N13-N18<\/h4>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u0438\u0437 \u043d\u0438\u0445, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u043e\u0442\u043a\u0443\u043f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;snoozeCount == 0&#8217; is always true. NotificationProvider.cpp 117<\/p>\n<pre><code class=\"cpp\">void NotificationProvider::handleSnooze(unsigned snoozeCount) {   if (snoozeCount > 0)    {     notifications[NotificationType::AlarmSnooze] =        std::make_shared&lt;notifications::AlarmSnoozeNotification>(snoozeCount);   }   else if (snoozeCount == 0)   {     notifications.erase(NotificationType::AlarmSnooze);   }    send(); } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u043a\u043e\u0434\u0443, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>snoozeCount<\/em> \u0438\u043c\u0435\u0435\u0442 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0442\u0438\u043f, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0443\u043b\u044f. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043b\u0438\u0448\u043d\u044f\u044f. \u041a\u043e\u0434 \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c, \u0435\u0441\u043b\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c <em>else if<\/em> \u043d\u0430 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 <em>else<\/em>:<\/p>\n<pre><code class=\"cpp\">void NotificationProvider::handleSnooze(unsigned snoozeCount) {   if (snoozeCount > 0)    {     notifications[NotificationType::AlarmSnooze] =        std::make_shared&lt;notifications::AlarmSnoozeNotification>(snoozeCount);   }   else   {     notifications.erase(NotificationType::AlarmSnooze);   }    send(); } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;currentState == ButtonState::Off&#8217; is always true. ButtonOnOff.cpp 33<\/p>\n<pre><code class=\"cpp\">enum class ButtonState : bool {   Off,   On }; .... void ButtonOnOff::switchState(const ButtonState newButtonState) {   currentState = newButtonState;   if (currentState == ButtonState::On)    {     ....   }   else if (currentState == ButtonState::Off)    {     ....   } } <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0435\u0433\u043e \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u0430\u0432\u0438\u0442\u044c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442: \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <em>enum<\/em> \u0441 \u043d\u0438\u0436\u0435\u043b\u0435\u0436\u0430\u0449\u0438\u043c \u0442\u0438\u043f\u043e\u043c <em>bool<\/em> \u0438 \u0434\u0432\u0443\u043c\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c.<\/p>\n<p>\u0412\u0441\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u0441\u043a\u043e\u0440\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0441\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0431\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0440\u0443\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0445\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0436\u0430\u0442\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442, \u0438 \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432 \u0441\u043a\u043e\u0440\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0430\u0432\u0442\u043e\u0440\u044b \u0441\u0434\u0435\u043b\u0430\u044e\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u0428\u0440\u0451\u0434\u0438\u043d\u0433\u0435\u0440\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0442\u0440\u0435\u0442\u044c\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a \u0436\u0435, \u043f\u043e\u043c\u0435\u043d\u044f\u0432 <em>else if<\/em> \u043d\u0430 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 <em>else<\/em>.<\/p>\n<pre><code class=\"cpp\">void ButtonOnOff::switchState(const ButtonState newButtonState) {   currentState = newButtonState;   if (currentState == ButtonState::On)    {     ....   }   else   {     ....   } } <\/code><\/pre>\n<p>\u0415\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;status != 0x00&#8217; is always false. AVRCP.cpp 68<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;stream_endpoint->close_stream == 1&#8217; is always false. avdtp.c 1223<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;stream_endpoint->abort_stream == 1&#8217; is always false. avdtp.c 1256<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;what == info_type::start_sector&#8217; is always true. disk_manager.cpp 340<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N19<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v609\/\">V609<\/a> [CERT-EXP37-C] Divide by zero. The &#8216;qfilter_CalculateCoeffs&#8217; function processes value &#8216;0&#8217;. Inspect the third argument. Check lines: &#8216;Equalizer.cpp:26&#8217;, &#8216;unittest_equalizer.cpp:91&#8217;. Equalizer.cpp 26<\/p>\n<pre><code class=\"cpp\">\/\/ Equalizer.cpp QFilterCoefficients qfilter_CalculateCoeffs(         FilterType filter, float frequency, uint32_t samplerate, float Q,          float gain) {   constexpr auto qMinValue         = .1f;   constexpr auto qMaxValue         = 10.f;   constexpr auto frequencyMinValue = 0.f;    if (frequency &lt; frequencyMinValue &amp;&amp; filter != FilterType::FilterNone)    {     throw std::invalid_argument(\"Negative frequency provided\");   }   if ((Q &lt; qMinValue || Q > qMaxValue) &amp;&amp; filter != FilterType::FilterNone)    {     throw std::invalid_argument(\"Q out of range\");   }   ....   float omega    = 2 * M_PI * frequency \/ samplerate;   .... } .... \/\/ unittest_equalizer.cpp const auto filterNone = qfilter_CalculateCoeffs(FilterType::FilterNone,                                                 0, 0, 0, 0); <\/code><\/pre>\n<p>\u0414\u0430, \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043e\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043d\u0430\u0448\u0438\u043c \u043c\u0435\u0436\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043c\u0435\u0436\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u2013 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043d\u043e\u0432\u0430\u044f \u0444\u0438\u0447\u0430 PVS-Studio. \u041f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0851\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044e. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0438\u0441\u0430\u043b \u0442\u0435\u0441\u0442, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432\u043d\u0443\u0442\u0440\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>qfilter_CalculateCoeffs<\/em>. \u0412\u0435\u0434\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 <em>0<\/em> \u0431\u0443\u0434\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>\u00b1Inf<\/em> \u0434\u043b\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0435\u0441\u043b\u0438 \u0442\u0438\u043f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 <em>IEC 559<\/em> \/ <em>IEEE 754<\/em>, \u0432 \u0438\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0442\u0430\u043a\u0436\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<\/li>\n<\/ul>\n<p>\u0423 \u043d\u0430\u0441 \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 <em>0<\/em>, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u044c. \u041a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u043e\u0434\u0430 \u043d\u0435 \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u043b \u0431\u044b \u044d\u0442\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/operator_arithmetic\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u044f\u0432\u043d\u043e \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0435\u0448\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N20-N21<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v617\/\">V617<\/a> Consider inspecting the condition. The &#8216;purefs::fs::inotify_flags::close_write&#8217; argument of the &#8216;|&#8217; bitwise operation contains a non-zero value. InotifyHandler.cpp 76<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v617\/\">V617<\/a> Consider inspecting the condition. The &#8216;purefs::fs::inotify_flags::del&#8217; argument of the &#8216;|&#8217; bitwise operation contains a non-zero value. InotifyHandler.cpp 79<\/p>\n<pre><code class=\"cpp\">namespace purefs::fs {   enum class inotify_flags : unsigned   {     attrib        = 0x01,     close_write   = 0x02,     close_nowrite = 0x04,     del           = 0x08,     move_src      = 0x10,     move_dst      = 0x20,     open          = 0x40,     dmodify       = 0x80,   };   .... }  sys::MessagePointer InotifyHandler::handleInotifyMessage                                    (purefs::fs::message::inotify *inotify) {   ....   if (inotify->flags        &amp;&amp;   (purefs::fs::inotify_flags::close_write            | purefs::fs::inotify_flags::move_dst))    {     ....   }   else if (inotify->flags             &amp;&amp;   ( purefs::fs::inotify_flags::del                  | purefs::fs::inotify_flags::move_src))    {     ....   }   .... } <\/code><\/pre>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0445\u043e\u0447\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 <em>inotify->flags<\/em> \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043e\u0434\u0438\u043d \u0438\u0437 \u0444\u043b\u0430\u0433\u043e\u0432. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <em>close_write<\/em> \u0438\u043b\u0438 <em>move_dst<\/em>, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 <em>del<\/em> \u0438\u043b\u0438 <em>move_src<\/em> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <em>|<\/em>, \u043a\u0430\u043a \u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 <em>flags<\/em> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <em>&amp;<\/em>.<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0438 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439. \u0412\u0435\u0434\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &amp;&amp; \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u0435\u043d.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 <em>&amp;&amp;<\/em> \u0438 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0435 <em>&amp;<\/em>. \u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">sys::MessagePointer InotifyHandler::handleInotifyMessage                                    (purefs::fs::message::inotify *inotify) {   ....   if (inotify->flags           &amp; (purefs::fs::inotify_flags::close_write            | purefs::fs::inotify_flags::move_dst))    {     ....   }   else if (inotify->flags                &amp; ( purefs::fs::inotify_flags::del                  | purefs::fs::inotify_flags::move_src))    {     ....   }   .... } <\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c GA \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u0430 \u0434\u0435\u043b\u0435 \u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435. \u0422\u0430\u043a\u0436\u0435 \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043a\u043e\u043d\u0435\u0446 \u043e\u043f\u0443\u0441\u0430 \u043f\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio. \u0411\u0443\u0434\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441: &#171;\u0410 \u0437\u0430\u0437\u0432\u043e\u043d\u0438\u0442 \u043b\u0438 \u0432\u0430\u0448 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a?&#187;.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c MuditaOS \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 <a href=\"https:\/\/pvs-studio.com\/ru\/pvs-studio\/download\/\">PVS-Studio<\/a> \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430. \u042d\u0442\u043e <a href=\"https:\/\/pvs-studio.com\/pvs-studio\/try-free\/?utm_source=habr&amp;utm_medium=articles&amp;utm_content=muditaos_p1&amp;utm_term=link_try-free\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e<\/a> \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/649091\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/649091\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2013 \u044d\u0442\u043e \u0442\u043e\u0442 \u0432\u0438\u0434 \u0441\u043e\u0444\u0442\u0430, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u043f\u043e\u043f\u0430\u043b\u0430 MuditaOS. \u0422\u0430\u043a \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p><a href=\"https:\/\/mudita.com\/\">MuditaOS<\/a> \u2013 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 FreeRTOS (<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0684\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435). \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 Mudita, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0438 \u0438 \u0447\u0430\u0441\u044b. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u044f\u0437\u044b\u043a\u0430\u0445 \u0421 \u0438 \u0421++. \u041d\u0443 \u0447\u0442\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442? \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0438 \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0438? \ud83d\ude42<\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u043f\u043e\u0434 Ubuntu 20.04 \u043f\u043e <a href=\"https:\/\/github.com\/mudita\/MuditaOS\/blob\/master\/doc\/quickstart.md\">\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/a> \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0430\u0441\u044c \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043b\u044f \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 Mudita Bell. \u041f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u043a\u043e\u043d\u0435\u0446 2021 \u0433\u043e\u0434\u0430, \u043e\u043d \u0441\u0442\u043e\u0438\u0442 <em>60$<\/em> \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044f \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0435\u0439 <a href=\"https:\/\/github.com\/mudita\/MuditaOS\/tree\/8cc1f779db7824a665240c5a89f1590a5831502c\">8cc1f77<\/a>.<\/p>\n<h3>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/h3>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N1-N3<\/h4>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c, \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u0434\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0441 \u043b\u0435\u043a\u0446\u0438\u0435\u0439 \u0432 \u0422\u0443\u043b\u0413\u0423 \u043f\u0440\u043e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0422\u0430\u043c, \u0432 \u0441\u043b\u0430\u0439\u0434\u0435 <em>\u043e \u0441\u0435\u0431\u0435<\/em>, \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0441\u044f \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c: \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435 PVS-Studio \u043e\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430 \u2013 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e. \u0412 \u043d\u0451\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u0443\u0437\u043b\u043e\u0432 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0437\u043b\u0430\u043c\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u0430\u0441\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 PVS-Studio \u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432\u0430\u043b\u0438\u043b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 (\u043f\u0440\u0438 \u043f\u0440\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0445), \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044f \u0431\u0435\u0437 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439 \u0437\u043d\u0430\u044e \u0442\u043e\u0447\u043d\u044b\u0439 \u0442\u0438\u043f \u0443\u0437\u043b\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e \u0443\u0437\u0435\u043b \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0434\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 MuditaOS \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u044f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0442\u0438\u043f\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v595\/\">V595<\/a> [CERT-EXP12-C] The &#8216;result&#8217; pointer was utilized before it was verified against nullptr. Check lines: 81, 82. AudioModel.cpp 81<\/p>\n<pre><code class=\"cpp\">void AudioModel::play(....) {   ....   auto cb = [_callback = callback, this](auto response)              {               auto result = dynamic_cast                             &lt;service::AudioStartPlaybackResponse *>(response);               lastPlayedToken = result->token;               if (result == nullptr)                {                 ....               }               ....             };   .... } <\/code><\/pre>\n<p>\u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0422\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>dynamic_cast<\/em>. \u041f\u043e\u0442\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u2014 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0437\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>nullptr<\/em>.<\/p>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <em>result<\/em> \u043f\u0435\u0440\u0435\u0434 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v757\/\">V757<\/a> [CERT-EXP12-C] It is possible that an incorrect variable is compared with nullptr after type conversion using &#8216;dynamic_cast&#8217;. Check lines: 214, 214. CallLogDetailsWindow.cpp 214<\/p>\n<pre><code class=\"cpp\">void CallLogDetailsWindow::onBeforeShow(...., SwitchData *data) {   ....   if (auto switchData = dynamic_cast                         &lt;calllog::CallLogSwitchData *>(data); data != nullptr)    {     ....   }   .... } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>dynamic_cast<\/em>. \u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>nullptr<\/em>, \u0445\u043e\u0442\u044f, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 <em>nullptr<\/em> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">void CallLogDetailsWindow::onBeforeShow(...., SwitchData *data) {   ....   if (auto switchData = dynamic_cast&lt;calllog::CallLogSwitchData *>(data))    {     ....   }   .... } <\/code><\/pre>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0435 \u0432\u0441\u0435\u043c \u043f\u043e \u0434\u0443\u0448\u0435, \u043d\u043e \u043c\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c \u2013 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0438 \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u043e\u0434\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u2014 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432\u0435\u0437\u0434\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u043b\u043e\u0445:<\/p>\n<pre><code class=\"cpp\">int x = ...; if (x = foo()) <\/code><\/pre>\n<p>\u041d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0445\u043e\u0442\u0435\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u0430\u043b\u0438\u0441\u044c, \u0438\u043b\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0441 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v559\/\">\u0440\u0443\u0433\u0430\u044e\u0442\u0441\u044f<\/a> \u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u0440\u0430\u0432\u044b. \u041a\u043e\u0434 \u043e\u043f\u0430\u0441\u0435\u043d \u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u0435\u043d. \u0414\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u0430\u043a \u0432 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0412 \u043d\u0451\u043c \u044f\u0432\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c. \u0410 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c == \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438.<\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043a\u043e\u0434\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412\u043e\u0442 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v757\/\">V757<\/a> [CERT-EXP12-C] It is possible that an incorrect variable is compared with nullptr after type conversion using &#8216;dynamic_cast&#8217;. Check lines: 47, 47. PhoneNameWindow.cpp 47<\/p>\n<pre><code class=\"cpp\">void PhoneNameWindow::onBeforeShow(ShowMode \/*mode*\/, SwitchData *data) {   if (const auto newData = dynamic_cast&lt;PhoneNameData *>(data);                                                              data != nullptr)    {     ....   } } <\/code><\/pre>\n<p>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">void PhoneNameWindow::onBeforeShow(ShowMode \/*mode*\/, SwitchData *data) {   if (const auto newData = dynamic_cast&lt;PhoneNameData *>(data))    {     ....   } } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u2013 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0443 \u043a\u043e\u0434\u0430 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/video\/10512\/\">\u0432\u0438\u0434\u0435\u043e<\/a>. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b \u2013 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c. \u041e\u043d\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0438 \u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \ud83d\ude42<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N4<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v522\/\">V522<\/a> [CERT-EXP34-C] Dereferencing of the null pointer &#8216;document&#8217; might take place. TextBlockCursor.cpp 332<\/p>\n<pre><code class=\"cpp\">auto BlockCursor::begin() -> std::list&lt;TextBlock>::iterator {   return document == nullptr              ? document->blocks.end() : document->blocks.begin(); } <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0435\u0439\u0441\u043f\u0430\u043b\u043c\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442: \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u044f\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <em>document<\/em> \u043d\u0430 <em>nullptr<\/em> \u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043e\u0431\u043e\u0438\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0446\u0435\u043b\u044c\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0431\u044b\u043b\u043e \u0443\u0440\u043e\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N5<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v517\/\">V517<\/a> [CERT-MSC01-C] 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: 1053, 1056. avdtp_util.c 1053<\/p>\n<pre><code class=\"cpp\">static uint16_t avdtp_signaling_setup_media_codec_mpeg_audio_config_event(....) {   uint8_t channel_mode_bitmap = ....;   ....   if (....)   {     ....   }   else if (channel_mode_bitmap &amp; 0x02)   {     num_channels = 2;     channel_mode = AVDTP_CHANNEL_MODE_STEREO;   }   else if (channel_mode_bitmap &amp; 0x02)   {     num_channels = 2;     channel_mode = AVDTP_CHANNEL_MODE_JOINT_STEREO;   }   .... } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430: \u043b\u0438\u0431\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043b\u0438\u0431\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430 \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430. \u0421\u0443\u0434\u044f \u043f\u043e \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u0434\u0432\u0443\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0451 \u0436\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c MuditaOS \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N6, N7<\/h4>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v571\/\">V571<\/a> Recurring check. The &#8216;if (activeInput)&#8217; condition was already verified in line 249. ServiceAudio.cpp 250<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;activeInput&#8217; is always true. ServiceAudio.cpp 250<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">std::optional&lt;AudioMux::Input *> AudioMux::GetActiveInput();  ....  auto Audio::handleSetVolume(....) -> std::unique_ptr&lt;AudioResponseMessage> {   ....   if (const auto activeInput = audioMux.GetActiveInput(); activeInput)    {     if (activeInput)      {       retCode = activeInput.value()->audio->SetOutputVolume(clampedValue);     }   }   .... } <\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u043c\u0438\u043d\u0438-\u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u0422\u0438\u043f <em>activeInput<\/em> &#8212; <em>std::optional<\/em> \u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 <em>AudioMux::Input<\/em>. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 \u043f\u043e\u0434 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c <em>if<\/em>, \u0442\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d <em>value.<\/em> \u041e\u043d\u0430 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0430\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 \u0431\u0440\u043e\u0441\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e* *\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u0430\u043a \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439, \u0442\u0430\u043a \u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c <em>if<\/em>. \u041c\u043c\u043c, \u044f \u0442\u043e\u0436\u0435 \u043b\u044e\u0431\u043b\u044e \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0438 \u0431\u0443\u043b\u0435\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 <em>std::optional<\/em>! \u0418 \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0431\u043b\u0438 \ud83d\ude42<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">std::optional&lt;AudioMux::Input *> AudioMux::GetActiveInput();  ....  auto Audio::handleSetVolume(....) -> std::unique_ptr&lt;AudioResponseMessage> {   ....   if (const auto activeInput = audioMux.GetActiveInput(); activeInput)    {     if (*activeInput)      {       retCode = (*activeInput)->audio->SetOutputVolume(clampedValue);     }   }   .... } <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N8-N11<\/h4>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v668\/\">V668<\/a> [CERT-MEM52-CPP] There is no sense in testing the &#8216;pcBuffer&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. syscalls_stdio.cpp 384<\/p>\n<pre><code class=\"cpp\">int _iosys_fprintf(FILE *__restrict __stream,                    const char *__restrict __format, ...) {   constexpr auto buf_len = 4096;   char *pcBuffer;   ....   pcBuffer = new char[buf_len];   if (pcBuffer == NULL)    {     ....   } } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <em>new (\u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043c\u043e\u0433\u0443 \u0441\u0443\u0434\u0438\u0442\u044c \u043f\u043e \u043a\u043e\u0434\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d),<\/em> \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 <em>NULL<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>new<\/em> \u043d\u0435 \u0441\u043c\u043e\u0433 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0442\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u044f\u0437\u044b\u043a\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>std::bad_alloc()<\/em>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u044e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/memory\/new\/nothrow\"><em>nothrow<\/em><\/a> \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 <em>new<\/em>:<\/p>\n<pre><code class=\"cpp\">int _iosys_fprintf(FILE *__restrict __stream,                    const char *__restrict __format, ...) {   constexpr auto buf_len = 4096;   char *pcBuffer;   ....   pcBuffer = new (std::nothrow) char[buf_len];   if (pcBuffer == NULL)    {     ....   } } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v668\/\">V668<\/a> [CERT-MEM52-CPP] There is no sense in testing the &#8216;fontData&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. FontManager.cpp 56<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v668\/\">V668<\/a> [CERT-MEM52-CPP] There is no sense in testing the &#8216;data&#8217;<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-328911","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328911","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=328911"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328911\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}