source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

sp/src/game/shared/ragdoll_shared.cpp: PVS-Studio: NULL Pointer Dereference

Open SviatoslavRazmyslov opened this issue 8 years ago • 1 comments

We have found and fixed a bug using PVS-Studio tool. PVS-Studio is a static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/

Analyzer warnings:

  • V595 The 'pRagdoll' pointer was utilized before it was verified against nullptr. Check lines: 883, 884. ragdoll_shared.cpp 883
  • V595 The 'pRagdoll' pointer was utilized before it was verified against nullptr. Check lines: 924, 925. ragdoll_shared.cpp 924

We suggests having a look at the emails, sent from @pvs-studio.com.

SviatoslavRazmyslov avatar Apr 11 '17 15:04 SviatoslavRazmyslov

We have found and fixed a bug using PVS-Studio tool. PVS-Studio is a static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/

Analyzer warnings:

  • V595 The 'pRagdoll' pointer was utilized before it was verified against nullptr. Check lines: 883, 884. ragdoll_shared.cpp 883
  • V595 The 'pRagdoll' pointer was utilized before it was verified against nullptr. Check lines: 924, 925. ragdoll_shared.cpp 924

We suggests having a look at the emails, sent from @pvs-studio.com.

Necroposter here. This also seems to be present in https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/shared/ragdoll_shared.cpp#L883 as well. It seems to be more widespread than previously thought.

If this fix is to be merged into the SDK repository, it must be duplicated for the Source SDK 2013 SP code branch as well as MP.

SC1040-TS2 avatar Apr 18 '21 22:04 SC1040-TS2