easyloggingpp icon indicating copy to clipboard operation
easyloggingpp copied to clipboard

Uninitialized memory use in copy constuctor

Open dimalinux opened this issue 3 years ago • 1 comments

https://github.com/amrayn/easyloggingpp/blob/8489989bb26c6371df103f6cbced3fbee1bc3c2f/src/easylogging%2B%2B.cc#L623

That line is passing uninitialized memory to safeDelete and if it is non-zero, it is calling delete.

dimalinux avatar Jul 22 '21 04:07 dimalinux

I think the next method in easylogging++.cc has the same problem too:

https://github.com/amrayn/easyloggingpp/blob/8489989bb26c6371df103f6cbced3fbee1bc3c2f/src/easylogging%2B%2B.cc#L635

What is the best solution?

  1. Remove these two lines, because they are not needed.

or,

  1. Initialize member m_typedConfigurations to nullptr in the class definition of Logger in easylogging++.h

simoc avatar Apr 01 '22 17:04 simoc