summaryrefslogtreecommitdiff
path: root/src/server.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-10-09 23:02:37 +0800
committerGitHub <noreply@github.com>2022-10-09 18:02:37 +0300
commit1cc511d7cb3b451c35bc511797e6e26f2f943c8e (patch)
treebdd17393695ca8d7a52a6fa24504df951123fcba /src/server.c
parent9b94e93eb8f20e0cb06ee7db513e7425601be4bf (diff)
downloadredis-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.c2
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 {