Skip to content

Commit

Permalink
RAR formats: Avoid a build warning
Browse files Browse the repository at this point in the history
The check_huffman() function isn't used unless HAVE_UNRAR, so we #ifdef
it to avoid build warnings.  Closes openwall#4731
  • Loading branch information
magnumripper committed Aug 9, 2021
1 parent 491483c commit c2ed3a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rar_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ static char *get_key(int index)
bits -= n; \
}

#if HAVE_UNRAR
/*
* This function is loosely based on JimF's check_inflate_CODE2() from
* pkzip_fmt. Together with the other bit-checks, we are rejecting over 96%
Expand Down Expand Up @@ -549,6 +550,7 @@ static MAYBE_INLINE int check_huffman(unsigned char *next) {
}
return 1; /* Passed this check! */
}
#endif

inline static void check_rar(rar_file *cur_file, int index, unsigned char *key, const unsigned char *_iv)
{
Expand Down

0 comments on commit c2ed3a6

Please sign in to comment.