PVS-Studio analysis of spdlog discovered some issues #3008
-
I have run PVS-studio analysis on my C++ project, including the external sources, one of them being spdlog. The analysis discovered a few issues in several files in spdlog\fmt\bundled directory. While the list of the issues found by PVS-Studio is not exhaustive, I decided to report some. These issues may need to be fixed. File format-inl.h: Line 1072: V557 Array underrun is possible. The value of 'offset' index could reach -594. Line 223: V610 Unspecified behavior. Check the shift operator '>>'. The left operand '-1' is negative. Line 224: V610 Unspecified behavior. Check the shift operator '>>'. The left operand is negative ('(e * 315653)' = [-827010860..827010860]). Line 230: V610 Unspecified behavior. Check the shift operator '>>'. The left operand is negative ('(e * 1741647)' = [-2147450751..2147450751]). Line 234: V610 Unspecified behavior. Check the shift operator '>>'. The left operand is negative ('(e * 631305 - 261663)' = [-1884707088..1853249817]). Line 358: V610 Undefined behavior. Check the shift operator '>>'. The right operand is negative ('(32 - beta)' = [-31..31]). Line 871: V730 Not all members of a class are initialized inside the constructor. Consider inspecting: ptr_. core.h: buffer(size_t sz) File core.h: Line 1584: V730 Not all members of a class are initialized inside the constructor. Consider inspecting: type_. Line 2798: V1037 Two or more case-branches perform the same actions. Check lines: 2798, 2804 Line 769: V560 A part of conditional expression is always false: 0 >= 1200. File common-inl.h: Line 56: V1067 Throwing from an exception constructor may lead to unexpected behavior. Consider to check function call. File format.h: Line 874: V1077 The 'basic_memory_buffer' constructor contains potentially uninitialized members. Inspect the following: store_. Lines 3674-3679: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
All sources under the |
Beta Was this translation helpful? Give feedback.
-
Please open an issue in the fmt lib repo (https://github.com/fmtlib/fmt) |
Beta Was this translation helpful? Give feedback.
Please open an issue in the fmt lib repo (https://github.com/fmtlib/fmt)