Opened 6 years ago

Last modified 3 months ago

#5288 new defect

Common C++ issues were found by PVS-Studio

Reported by: Vladislav Belov Owned by: animus
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by animus)

From https://wildfiregames.com/forum/index.php?/topic/24742-i-found-19-simple-issues-in-c-code/

https://www.viva64.com/en/b/0581/

There are three kind of errors:

  • main pyrogenesis code
  • internal pyrogenesis libraries (the biggest set of errors)
  • third-party libraries

N1: Here

N2: Here

N3: Here

N4: Code no longer exists. Since [23364]

N5: Here

N6: Here

N7, N8: Here

N9, N10, N11: Here

N12: Here

N13: Code no longer exists Here

N14, N15: Here

Change History (17)

comment:1 by Vladislav Belov, 6 years ago

Description: modified (diff)

comment:2 by elexis, 6 years ago

Description: modified (diff)

comment:3 by Stan, 5 years ago

In 23029:

Cleanup CCmpRallyPointRenderer

Replace std::deque by std::vector
Replace some casts by cpp casts
Move the class and struct declaration to a separate file for clarity.
Fixes rP10704 by removing offending function
Refs #5288
Refs D1681

Reviewed by: @vladislavbelov

Differential Revision: https://code.wildfiregames.com/D1682

comment:4 by Vladislav Belov, 3 years ago

In 24903:

Fixes leaking of a file handle in case of an error. Refs #5288

Reported By: PVS-Studio

comment:5 by Vladislav Belov, 3 years ago

In 24905:

Fixes UB in shared_ptr usage of an array. Refs #5288

Reported By: PVS-Studio

comment:6 by animus, 12 months ago

Description: modified (diff)

Adding completed tasks to the ticket for easier tracking.

Last edited 12 months ago by animus (previous) (diff)

comment:7 by animus, 12 months ago

Description: modified (diff)
Owner: set to animus

comment:8 by animus, 12 months ago

Description: modified (diff)

comment:9 by phosit, 12 months ago

Description: modified (diff)

Add commit when N4 was removed. sera found it because sera knows git better than me ;).

comment:10 by animus, 11 months ago

Description: modified (diff)

comment:11 by animus, 11 months ago

Description: modified (diff)

Removed "Awaiting review" and made it easier on the eyes.

comment:12 by animus, 11 months ago

Description: modified (diff)

N13's function was missing, added the changeset in which it was removed.

comment:13 by animus, 11 months ago

Description: modified (diff)

prettify

comment:14 by animus, 11 months ago

Description: modified (diff)

N14, N15 are no longer present.

comment:15 by Itms, 11 months ago

In 27647:

Check the validity of a couple pointers in low-level tests, refs #5288.

Reported By: PVS-Studio
Patch By: animus
Reviewed By: phosit

Differential Revision: https://code.wildfiregames.com/D4994

comment:16 by phosit, 10 months ago

In 27751:

Change %c to %lc for wchar arguments.
swprintf_s expected an argument of type char (due to %c). Given an argument of type wchar.
This fixes N7 and N8 from #5288

Refs #5288

Patch By: @animus

Accepted By: @phosit, @vladislavbelov

Differential Revision: https://code.wildfiregames.com/D4993

comment:17 by phosit, 3 months ago

In 28014:

Don't check memory allocation made using new

Refs: #5288

Patch By: @animus
Accepted By: @phosit
Comments By: @vladislavbelov

Differential Revision: https://code.wildfiregames.com/D5234

Note: See TracTickets for help on using tickets.