Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mayaqua/Kernel.c')
-rw-r--r--src/Mayaqua/Kernel.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/Mayaqua/Kernel.c b/src/Mayaqua/Kernel.c
index 7b97bade..885906ff 100644
--- a/src/Mayaqua/Kernel.c
+++ b/src/Mayaqua/Kernel.c
@@ -1,21 +1,21 @@
// SoftEther VPN Source Code - Stable Edition Repository
// Mayaqua Kernel
//
-// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
+// SoftEther VPN Server, Client and Bridge are free software under the Apache License, Version 2.0.
//
// Copyright (c) Daiyuu Nobori.
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
// Copyright (c) SoftEther Corporation.
+Copyright (c) all contributors on SoftEther VPN project in GitHub.
//
// All Rights Reserved.
//
// http://www.softether.org/
//
-// Author: Daiyuu Nobori, Ph.D.
+// This stable branch is officially managed by Daiyuu Nobori, the owner of SoftEther VPN Project.
+// Pull requests should be sent to the Developer Edition Master Repository on https://github.com/SoftEtherVPN/SoftEtherVPN
// Contributors:
// - nattoheaven (https://github.com/nattoheaven)
-// Comments: Tetsuo Sugiyama, Ph.D.
-//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 2 as published by the Free Software Foundation.
@@ -548,7 +548,7 @@ void GetHomeDirW(wchar_t *path, UINT size)
if (GetEnvW(L"HOMEDRIVE", drive, sizeof(drive)) &&
GetEnvW(L"HOMEPATH", hpath, sizeof(hpath)))
{
- UniFormat(path, sizeof(path), L"%s%s", drive, hpath);
+ UniFormat(path, size, L"%s%s", drive, hpath);
}
else
{
@@ -2137,6 +2137,15 @@ UINT64 SystemToUINT64(SYSTEMTIME *st)
}
time = SystemToTime(st);
+
+ //For times before 1970-01-01, clamp to the minimum
+ //because we have to return an unsigned integer.
+ //This is less wrong than casting it to UINT64
+ //and returning a time far in the future.
+ //For some reason we subtract 9 hours below, so
+ //account for that here.
+ if( time < 32400000LL ) return 0;
+
sec64 = (UINT64)time * (UINT64)1000;
sec64 += st->wMilliseconds;