Variable ((float( 64))hits + misses) with a floating-point type whose possible value set allows a zero value at redis-cli.c:9848 is used as a denominator at redis-cli.c:9848. The result of division is further used without a check for NaN, which leads to undefined program behavior.

Since LRUTestMode is a special testing mode for evaluating the performance and efficiency of the LRU algorithm (Least Recently Used), which displaces data from the cache and deletes those items that have not been used for the longest time, hits and misses can be equal to 0 simultaneously if the test has not performed any read operations, and all get operations have completed with errors

Line in /src/redis-cli.c:9848 https://github.com/redis/redis/blob/8.0.3/src/redis-cli.c#L9848

 misses, (double)misses/(hits+misses)*100);

It is recommended to add null check.

Found by Linux Verification Center ( linuxtesting.org ) with SVACE Reporter: Gushchin Egor ( guschin058@yandex.ru )