Make sure that double fits into uint64_t

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic521383f71c1865ae18fc880b79493c52285e29b
pull/2457/head
Miklos Vajna 2021-05-26 09:55:53 +02:00
parent 9587f4c816
commit bc0401fc49
2 changed files with 1 additions and 1 deletions

View File

@ -448,7 +448,7 @@ bool ClientSession::_handleInput(const char *buffer, int length)
str = perfcounter.data();
endptr = nullptr;
double counter = strtod(str, &endptr);
if (*endptr == '\0')
if (*endptr == '\0' && (counter < (double)(std::numeric_limits<uint64_t>::max() / 1000)))
{
// Now we know how to translate from the client's performance.now() values to
// microseconds since the epoch.