Dear list, I've just received this report. However, the dereferencing has been taken care of within a LASSERT. What do you suggest I do? It would be best to avoid that this report comes again, so I think something must be done.
The least clean option seems to unroll the macro in the code (calling lyx::doAssert if needed), but that seems to defeat the principle of having a macro to do the check. On Fri, 29 Oct 2021 at 12:09, <scan-ad...@coverity.com> wrote: > Hi, > > Please find the latest report on new defect(s) introduced to LyX found > with Coverity Scan. > > 1 new defect(s) introduced to LyX found with Coverity Scan. > > > New defect(s) Reported-by: Coverity Scan > Showing 1 of 1 defect(s) > > > ** CID 373784: Null pointer dereferences (NULL_RETURNS) > > > > ________________________________________________________________________________________________________ > *** CID 373784: Null pointer dereferences (NULL_RETURNS) > /home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetText.cpp: 667 in > lyx::InsetText::docbookRenderAsImage(lyx::XMLStream &, const > lyx::OutputParams &, lyx::InsetText::XHTMLOptions) const() > 661 // unlike a preview that is not immediately required for > display. > 662 docstring const latex_snippet = > insetToLaTeXSnippet(&buffer(), this); > 663 std::string const snippet = > support::trim(to_utf8(latex_snippet)); > 664 // TODO: no real support for Unicode. This code is very > similar to RenderPreview::addPreview, the same gotcha applies. > 665 > 666 graphics::PreviewLoader* loader = buffer().loader(); > >>> CID 373784: Null pointer dereferences (NULL_RETURNS) > >>> Dereferencing a pointer that might be "nullptr" "loader" when > calling "add". > 667 loader->add(snippet); > 668 loader->startLoading(true); // Generate the image and wait > until done. > 669 graphics::PreviewImage const * img = > loader->preview(snippet); > 670 LASSERT(img != nullptr, return); > 671 support::FileName const & filename = img->filename(); > 672 > > > > ________________________________________________________________________________________________________ > To view the defects in Coverity Scan visit, > https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yoTScfh6B8koVa-2BsXrqsH2rakc2gNT9XVT9OAWzJMkQwg-3D-3D7p_B_EaoV9iDrwluI0GGUrbM7yWAc9ILy2qIm0bzgdOF2o6OOVVMnccelAcH0Rsnhd7iZrvpDqOh-2F455p1AxPmi2-2BUWDwUOupmHg7eryUc3h-2F3lvXhDZ8cPqbDcT7FWl56ckZlehZQWWFDceGYhxJ4K6XgjbZW6vkTJDgoEQ99WaSukO6xOTrBg-2FD-2FrYIrXqgPVVK21ts5FYRjc9TE2XwWbDRqg-3D-3D > > To manage Coverity Scan email notifications for "dourou...@gmail.com", > click > https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxxF-2FO44sWaogU6jGZMVL91U2CAiKpstwf-2F8GS1cLm5bQFa2vNdaMB9I0sFa-2FifkyGPDQ9lPJpxrLzv5JkQQq3cjY6Xeg-2Bcz9nS6BMFhNQsBU-3DZss-_EaoV9iDrwluI0GGUrbM7yWAc9ILy2qIm0bzgdOF2o6OOVVMnccelAcH0Rsnhd7iZbT-2FxIhGAj1i8O6PBcuuEArYokxU8G-2Bx-2FMjso4kXgxRg7czczKM74-2Fbi0zZnSWvzZDt9MJjH64hzj4v8nUNWMEwthcTVKf0k-2BwSXJGXbKDhQbzmiFECB9N7ezkP-2BSsyFU2lVc2pksThJO7Id8w26gYQ-3D-3D > >
-- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel