Skip to content

Commit

Permalink
stop_expire_timer(): Fix uninitialized memory access
Browse files Browse the repository at this point in the history
The severity is low, however, since uninitialized integer math is still
safe (from a stability PoV), with the resulting value being ignored
anyway.

Fixes CID #199911, #199922, #199926, #199966, #199987, #199990, #200085,
 #200054.
  • Loading branch information
liviuchircu committed Jul 9, 2020
1 parent eb018ad commit c6682f2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ut.h
Expand Up @@ -1124,12 +1124,14 @@ static inline int str_strcasecmp(const str *stra, const str *strb)
#define __stop_expire_timer(begin,threshold,func_info, \
extra_s,extra_len,tcp,_slow_stat) \
do { \
int __usdiff__ = get_time_diff(&(begin)); \
if ((threshold) && __usdiff__ > (threshold)) { \
log_expiry(__usdiff__,(threshold),(func_info), \
(extra_s),(extra_len),tcp); \
if (_slow_stat) \
inc_stat(_slow_stat); \
if (threshold) { \
int __usdiff__ = get_time_diff(&(begin)); \
if (__usdiff__ > (threshold)) { \
log_expiry(__usdiff__,(threshold),(func_info), \
(extra_s),(extra_len),tcp); \
if (_slow_stat) \
inc_stat(_slow_stat); \
} \
} \
} while(0)

Expand Down

0 comments on commit c6682f2

Please sign in to comment.