Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

PVS-Studio: fixed vulnerability CWE-476 (NULL Pointer Dereference) #16807

Merged
merged 10 commits into from Mar 10, 2017
Expand Up @@ -104,7 +104,7 @@ private void RecordType(AggregateType type, Symbol sym)
_csym++;

// If it is first, record it.
if (_swtFirst == null)
if (_swtFirst != null)
{
_swtFirst.Set(sym, type);
Debug.Assert(_csym == 1);
Expand Down
2 changes: 1 addition & 1 deletion src/System.Data.Common/src/System/Data/SimpleType.cs
Expand Up @@ -364,7 +364,7 @@ internal string HasConflictingDefinition(SimpleType otherSimpleType)

if (!string.Equals(BaseType, otherSimpleType.BaseType, StringComparison.Ordinal))
return ("BaseType");
if ((BaseSimpleType == null && otherSimpleType.BaseSimpleType != null) &&
if ((BaseSimpleType != null && otherSimpleType.BaseSimpleType != null) &&
(BaseSimpleType.HasConflictingDefinition(otherSimpleType.BaseSimpleType)).Length != 0)
return ("BaseSimpleType");
return string.Empty;
Expand Down