Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#1648·SoftEtherVPN

src/Mayaqua/Unix.c: coverity Y2K38 finding

Author: chipitsineCreated Aug 15, 2022Updated Aug 6, 2026
*** CID 380096:  High impact quality  (Y2K38_SAFETY)
/src/Mayaqua/Unix.c: 1976 in UnixGetSystemTime()
1970            Zero(&tz, sizeof(tz));
1971     
1972            time(&now);
1973     
1974            if (sizeof(time_t) == 4)
1975            {
>>>     CID 380096:  High impact quality  (Y2K38_SAFETY)
>>>     A "time_t" value is stored in an integer with too few bits to accommodate it.  The expression "now" is cast to "UINT".
1976                    now2 = (time_64t)((UINT64)((UINT)now));
1977            }
1978            else
1979            {
1980                    now2 = now;
1981            }

Source: SoftEtherVPN/SoftEtherVPN

View original on GitHubView discussion on GitHub