Skip to content
Permalink
Browse files Browse the repository at this point in the history
fix V522 [CWE-690] There might be dereferencing of a potential null p…
…ointer 'Gmt'.
  • Loading branch information
pavel-pimenov committed Sep 12, 2020
1 parent 14b165e commit 6475fcc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/ZenLib/Ztring.cpp
Expand Up @@ -1364,6 +1364,8 @@ Ztring& Ztring::Date_From_Seconds_1970_Local (const int32u Value)
#endif
Ztring DateT;
Ztring Date;
if (Gmt)
{
Date+=Ztring::ToZtring((Gmt->tm_year+1900));
Date+=__T("-");
DateT.From_Number(Gmt->tm_mon+1); if (DateT.size()<2){DateT=Ztring(__T("0"))+Ztring::ToZtring(Gmt->tm_mon+1);}
Expand All @@ -1381,6 +1383,7 @@ Ztring& Ztring::Date_From_Seconds_1970_Local (const int32u Value)
DateT.From_Number(Gmt->tm_sec); if (DateT.size()<2){DateT=Ztring(__T("0"))+Ztring::ToZtring(Gmt->tm_sec);}
Date+=DateT;
assign (Date.c_str());
}
return *this;
}

Expand Down

0 comments on commit 6475fcc

Please sign in to comment.