Print this page
11204 smatch issue in zlib/deflate.c

Split Close
Expand all
Collapse all
          --- old/usr/src/contrib/zlib/deflate.c
          +++ new/usr/src/contrib/zlib/deflate.c
↓ open down ↓ 180 lines elided ↑ open up ↑
 181  181     (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
 182  182      match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
 183  183      s->head[s->ins_h] = (Pos)(str))
 184  184  #endif
 185  185  
 186  186  /* ===========================================================================
 187  187   * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
 188  188   * prev[] will be initialized on the fly.
 189  189   */
 190  190  #define CLEAR_HASH(s) \
 191      -    s->head[s->hash_size-1] = NIL; \
 192      -    zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
      191 +    do { \
      192 +        s->head[s->hash_size-1] = NIL; \
      193 +        zmemzero((Bytef *)s->head, \
      194 +        (unsigned)(s->hash_size-1)*sizeof(*s->head)); \
      195 +    } while (0)
 193  196  
 194  197  /* ===========================================================================
 195  198   * Slide the hash table when sliding the window down (could be avoided with 32
 196  199   * bit values at the expense of memory usage). We slide even when level == 0 to
 197  200   * keep the hash table consistent if we switch back to level > 0 later.
 198  201   */
 199  202  local void slide_hash(s)
 200  203      deflate_state *s;
 201  204  {
 202  205      unsigned n, m;
↓ open down ↓ 1959 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX