diff options
author | Binbin <binloveplay1314@qq.com> | 2022-10-09 23:02:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-09 18:02:37 +0300 |
commit | 1cc511d7cb3b451c35bc511797e6e26f2f943c8e (patch) | |
tree | bdd17393695ca8d7a52a6fa24504df951123fcba /src/server.c | |
parent | 9b94e93eb8f20e0cb06ee7db513e7425601be4bf (diff) | |
download | redis-1cc511d7cb3b451c35bc511797e6e26f2f943c8e.tar.gz |
Fix TIME command microseconds overflow under 32-bits (#11368)
The old `server.unixtime*1000000` will overflow in 32-bits.
This was introduced in #10300 (not released).
Diffstat (limited to 'src/server.c')
-rw-r--r-- | src/server.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c index 617a5e3bc..cb0faf888 100644 --- a/src/server.c +++ b/src/server.c @@ -4373,7 +4373,7 @@ void echoCommand(client *c) { void timeCommand(client *c) { addReplyArrayLen(c,2); addReplyBulkLongLong(c, server.unixtime); - addReplyBulkLongLong(c, server.ustime-server.unixtime*1000000); + addReplyBulkLongLong(c, server.ustime-((long long)server.unixtime)*1000000); } typedef struct replyFlagNames { |