cgit icon indicating copy to clipboard operation
cgit copied to clipboard

Fix V568, V579, V512 warnings from PVS-Studio Static Analyzer

Open buslov opened this issue 6 years ago • 0 comments

I'm a member of the Pinguem.ru competition on finding errors in open source projects. A bug, found using PVS-Studio.

Warnings:

  • It's odd that 'sizeof()' operator evaluates the size of a pointer to a class, but not the size of the 'ctx' class object.
  • The memset function receives the pointer and its size as arguments. It is possibly a mistake.
  • A call of the 'memset' function will lead to underflow of the buffer 'ctx'.

buslov avatar Oct 31 '17 19:10 buslov