lyx_mirror/src/insets
Thibaut Cuvelier 2d56c01dcf InsetIndex: make a condition more bullet-proof, a nullptr could be dereferenced.
Error noticed by Coverity:

*** CID 382777:  Memory - illegal accesses  (RETURN_LOCAL)
/home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetIndex.cpp: 1866 in _ZNK3lyx15InsetPrintIndex5xhtmlB5cxx11ERNS_9XMLStreamERKNS_12OutputParamsE()
1860
1861            // Collect the index entries in a form we can use them.
1862            vector<IndexEntry> entries;
1863            const docstring & indexType = params().getParamOr("type", from_ascii("idx"));
1864            for (const TocItem& item : *toc) {
1865                    const auto* inset = static_cast<const InsetIndex*>(&(item.dit().inset()));
>>>     CID 382777:  Memory - illegal accesses  (RETURN_LOCAL)
>>>     Using "indexType", which points to an out-of-scope temporary variable of type "lyx::docstring const".
1866                    if (item.isOutput() && inset->params().index == indexType)
1867                            entries.emplace_back(IndexEntry{inset, &op});
1868            }
1869
1870            // If all the index entries are in notes or not displayed, get out sooner.
1871            if (entries.empty())
2023-01-08 22:19:39 +01:00
..
CMakeLists.txt prevent Qt6 from defining UNICODE (Qt6.1.1 and upwards) 2021-06-19 10:48:49 +02:00
ExternalSupport.cpp Fix warnings regarding switches on enum values 2020-11-25 23:16:56 +02:00
ExternalSupport.h
ExternalTemplate.cpp Add default TransformID enum value 2020-11-25 02:43:35 +02:00
ExternalTemplate.h
ExternalTransforms.cpp Include standard <regex> 2020-11-29 15:27:28 +02:00
ExternalTransforms.h Add default TransformID enum value 2020-11-25 02:43:35 +02:00
Inset.cpp When Inset::dispatch is called from TOC, process screen flags 2022-11-04 21:46:32 +01:00
Inset.h Introduce index-tag-all lfun 2022-11-05 18:39:33 +01:00
InsetArgument.cpp Sync with master 2022-10-26 10:52:21 +02:00
InsetArgument.h Make sure that language is "latex" in InsetArgument when pass-thru. 2021-10-21 19:14:06 +02:00
InsetBibitem.cpp Refactor OutputParams 2020-11-30 13:05:03 +02:00
InsetBibitem.h
InsetBibtex.cpp FindAdv: Use private variable for_search 2022-05-09 22:11:38 +02:00
InsetBibtex.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetBox.cpp Prevent more local colors from leaking (#6626) 2021-01-22 10:34:41 +01:00
InsetBox.h
InsetBranch.cpp Sync with master 2022-10-26 10:52:21 +02:00
InsetBranch.h
InsetCaption.cpp Add HTMLClass for InsetLayout as well. Layout format change. 2022-12-05 23:42:50 -05:00
InsetCaption.h Sync with master 2022-10-26 10:52:21 +02:00
InsetCaptionable.cpp DocBook: refactor code about retrieving captions and labels. 2020-11-15 04:03:04 +01:00
InsetCaptionable.h DocBook: refactor code about retrieving captions and labels. 2020-11-15 04:03:04 +01:00
InsetCitation.cpp Fix bug #10646. 2021-02-10 16:04:25 -05:00
InsetCitation.h Fix bug #10646. 2021-02-10 16:04:25 -05:00
InsetCode.h Introduce InsetIndexMacros 2022-04-19 11:46:08 +02:00
InsetCollapsible.cpp Revert "Remove left/right spacing around top/left buttons" 2022-12-11 20:48:44 +01:00
InsetCollapsible.h Move getFont and getLabelFont from InsetCollapsible to Inset 2021-03-24 20:04:27 +01:00
InsetCommand.cpp Fix crash (missing Buffer update) 2021-01-14 17:17:58 +01:00
InsetCommand.h Cleanup button handling in InsetInclude 2021-01-19 19:24:10 +01:00
InsetCommandParams.cpp Fix bug #11410. 2022-12-04 18:33:58 -05:00
InsetCommandParams.h Fix bug #11410. 2022-12-04 18:33:58 -05:00
InsetCounter.cpp Use LaTeXName of counter in LaTeX output. 2020-12-05 16:46:33 -05:00
InsetCounter.h
InsetERT.cpp Remove debug output. 2022-04-02 03:34:32 +02:00
InsetERT.h
InsetExternal.cpp Fix C++20 warning on implicit capture of this via [=] 2020-12-28 23:26:14 +02:00
InsetExternal.h
InsetFlex.cpp Sync with master 2022-10-26 10:52:21 +02:00
InsetFlex.h Correctly show deleted url with change tracking 2021-02-17 19:51:01 +01:00
InsetFloat.cpp Sync with master 2022-10-26 10:52:21 +02:00
InsetFloat.h Sync with master 2022-10-26 10:52:21 +02:00
InsetFloatList.cpp
InsetFloatList.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetFoot.cpp DocBook: fix handling of footnotes. 2021-05-24 23:36:37 +02:00
InsetFoot.h Revert "Fix bug #10263" 2021-04-13 10:21:25 +02:00
InsetFootlike.cpp Remove unneeded InsetFootlike::metrics/draw() methods 2021-03-24 16:25:43 +01:00
InsetFootlike.h Remove unneeded InsetFootlike::metrics/draw() methods 2021-03-24 16:25:43 +01:00
InsetGraphics.cpp Amend 8a0715d0bd 2022-02-27 10:02:52 +01:00
InsetGraphics.h Refactor OutputParams 2020-11-30 13:05:03 +02:00
InsetGraphicsParams.cpp Add option to revert graphics colors in dark mode (#12076) 2021-01-18 10:46:16 +01:00
InsetGraphicsParams.h Make InsetInfo math/IPA icons visible in dark mode 2020-12-13 09:51:32 +01:00
InsetHyperlink.cpp Associate "run:" link types with "Other" 2022-12-26 13:19:52 +01:00
InsetHyperlink.h Count words in hyperlink 2021-01-10 01:54:40 -05:00
InsetInclude.cpp FindAdv: Use private variable for_search 2022-05-09 22:11:38 +02:00
InsetInclude.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetIndex.cpp InsetIndex: make a condition more bullet-proof, a nullptr could be dereferenced. 2023-01-08 22:19:39 +01:00
InsetIndex.h Introduce index-tag-all lfun 2022-11-05 18:39:33 +01:00
InsetIndexMacro.cpp Fix output of subentry with sortkey 2022-11-01 11:55:57 +01:00
InsetIndexMacro.h Handle empty index subentries (#7820) 2022-11-01 10:20:50 +01:00
InsetInfo.cpp Adapt inset info to new version check 2022-12-19 17:42:49 +01:00
InsetInfo.h Fixup 12dfdbf0: intercept validate(), not latex() 2022-03-10 17:10:17 +01:00
InsetIPA.cpp Refactor OutputParams 2020-11-30 13:05:03 +02:00
InsetIPA.h
InsetIPAMacro.cpp InsetIPAMacro: implement the XHTML conversion, refactor plaintext and DocBook to share more code. 2022-12-26 20:54:36 +01:00
InsetIPAMacro.h
InsetLabel.cpp Fix crash when inserting label before label in change tracking mode 2022-12-05 11:15:58 +01:00
InsetLabel.h Fix crash when inserting label before label in change tracking mode 2022-12-05 11:15:58 +01:00
InsetLayout.cpp LyXHTML: switch the doctype to (X)HTML5 and only output XML entities. 2022-12-25 20:48:14 +01:00
InsetLayout.h Add HTMLClass for InsetLayout as well. Layout format change. 2022-12-05 23:42:50 -05:00
InsetLine.cpp Allow line inset to draw a vertical line. 2021-06-14 15:45:35 +02:00
InsetLine.h
InsetListings.cpp Sync with master 2022-10-26 10:52:21 +02:00
InsetListings.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetListingsParams.cpp LyXHTML: switch the doctype to (X)HTML5 and only output XML entities. 2022-12-25 20:48:14 +01:00
InsetListingsParams.h
InsetMarginal.cpp Refactor OutputParams 2020-11-30 13:05:03 +02:00
InsetMarginal.h
InsetNewline.cpp Improve row flushing 2021-12-07 17:04:47 +01:00
InsetNewline.h Improve row flushing 2021-12-07 17:04:47 +01:00
InsetNewpage.cpp Remove useless breaks 2020-12-01 00:46:02 +02:00
InsetNewpage.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetNomencl.cpp Fix comment 2021-01-14 08:57:15 +01:00
InsetNomencl.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetNote.cpp Fix bug #11853 2022-12-03 23:03:33 -05:00
InsetNote.h Improve the description of Inset::inheritFont() 2021-04-13 10:37:25 +02:00
InsetPhantom.cpp Refactor OutputParams 2020-11-30 13:05:03 +02:00
InsetPhantom.h
InsetPreview.cpp Factor out the generation of the code to create a preview. 2021-10-13 19:26:49 +02:00
InsetPreview.h Factor out the generation of the code to create a preview. 2021-10-13 19:26:49 +02:00
InsetQuotes.cpp LyXHTML: switch the doctype to (X)HTML5 and only output XML entities. 2022-12-25 20:48:14 +01:00
InsetQuotes.h LyXHTML: switch the doctype to (X)HTML5 and only output XML entities. 2022-12-25 20:48:14 +01:00
InsetRef.cpp Fix bug #11410. 2022-12-04 18:33:58 -05:00
InsetRef.h Fix bug #11104. Activate refstyle support for InsetMathRef. 2021-01-05 18:17:53 -05:00
InsetScript.cpp Refactor OutputParams 2020-11-30 13:05:03 +02:00
InsetScript.h More enums & includes refactoring 2020-12-06 18:26:41 +02:00
InsetSeparator.cpp Refactor OutputParams 2020-11-30 13:05:03 +02:00
InsetSeparator.h Improve row flushing 2021-12-07 17:04:47 +01:00
InsetSpace.cpp DocBook/HTML: use XML entities for spaces. 2022-12-26 19:11:41 +01:00
InsetSpace.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetSpecialChar.cpp Amend bc73a85778 2022-12-26 00:18:47 +01:00
InsetSpecialChar.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetTabular.cpp \R and \L are not defined in babel with Xe/LuaTeX 2022-12-23 10:07:41 +01:00
InsetTabular.h Sync with master 2022-10-26 10:52:21 +02:00
InsetText.cpp Add HTMLClass for InsetLayout as well. Layout format change. 2022-12-05 23:42:50 -05:00
InsetText.h Sync with master 2022-10-26 10:52:21 +02:00
InsetTOC.cpp Fix bug #11418. 2022-12-04 00:33:14 -05:00
InsetTOC.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetVSpace.cpp \\noindent in a paragraph that starts with \\vspace is possible 2021-10-31 11:56:53 +01:00
InsetVSpace.h Implement Row::Element::row_flags 2021-12-07 17:04:47 +01:00
InsetWrap.cpp Add HTMLClass for InsetLayout as well. Layout format change. 2022-12-05 23:42:50 -05:00
InsetWrap.h Fix unintialized variables spotted by coverity 2022-02-20 17:03:33 +01:00
RenderBase.h Make InsetInfo math/IPA icons visible in dark mode 2020-12-13 09:51:32 +01:00
RenderButton.cpp Make InsetInfo math/IPA icons visible in dark mode 2020-12-13 09:51:32 +01:00
RenderButton.h Remove RenderButton::button_box_, which is unused. 2021-01-19 11:27:54 +01:00
RenderGraphic.cpp Make InsetInfo math/IPA icons visible in dark mode 2020-12-13 09:51:32 +01:00
RenderGraphic.h Make InsetInfo math/IPA icons visible in dark mode 2020-12-13 09:51:32 +01:00
RenderPreview.cpp Typos and comment improvements. 2021-10-13 19:26:49 +02:00
RenderPreview.h Merge namespace signals2 into namespace lyx 2020-12-19 22:52:51 +02:00