ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.73k stars 1.99k forks source link

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

Open SviatoslavRazmyslov opened 7 years ago

SviatoslavRazmyslov commented 7 years ago

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:

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

SC1040-TS2 commented 3 years ago

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.