From: Eric Biggers Date: Sun, 8 Jan 2017 06:34:32 +0000 (-0800) Subject: hc_matchfinder: use well-defined initialization of best_matchptr X-Git-Tag: v1.11.0~8 X-Git-Url: https://wimlib.net/git/?a=commitdiff_plain;h=57d737c7204581835289fd70fb5b83ca9c436e65;p=wimlib hc_matchfinder: use well-defined initialization of best_matchptr The initial value of best_matchptr is not truly used, but since we do always compute 'in_next - best_matchptr', assign an initial value which avoids undefined behavior. --- diff --git a/include/wimlib/hc_matchfinder.h b/include/wimlib/hc_matchfinder.h index aa2e4542..b0c8c65a 100644 --- a/include/wimlib/hc_matchfinder.h +++ b/include/wimlib/hc_matchfinder.h @@ -197,7 +197,7 @@ TEMPLATED(hc_matchfinder_longest_match)(struct TEMPLATED(hc_matchfinder) * const { const u8 *in_next = in_begin + cur_pos; u32 depth_remaining = max_search_depth; - const u8 *best_matchptr = best_matchptr; /* uninitialized */ + const u8 *best_matchptr = in_next; mf_pos_t cur_node3, cur_node4; u32 hash3, hash4; u32 next_seq3, next_seq4;