diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-30 04:50:21 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-30 04:50:21 +0200 |
commit | acaaca839abada0d0718375ba03dcaeddda15d9e (patch) | |
tree | 73f1a0603b61c17156878aee1c7d234e61dd6e19 /archival/libunarchive/unxz/xz_dec_stream.c | |
parent | 6948f210ed443f8153e0ba751e77bec8a0c6c8d4 (diff) |
unxz: remove debugging. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libunarchive/unxz/xz_dec_stream.c')
-rw-r--r-- | archival/libunarchive/unxz/xz_dec_stream.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/archival/libunarchive/unxz/xz_dec_stream.c b/archival/libunarchive/unxz/xz_dec_stream.c index e10c9413d..121c3b53a 100644 --- a/archival/libunarchive/unxz/xz_dec_stream.c +++ b/archival/libunarchive/unxz/xz_dec_stream.c @@ -365,16 +365,14 @@ static enum xz_ret XZ_FUNC dec_stream_header(struct xz_dec *s) /* * Decode the Stream Flags field. Of integrity checks, we support * only none (Check ID = 0) and CRC32 (Check ID = 1). + * We also accept CRC64 and SHA-256, but they will not be verified. */ if (s->temp.buf[HEADER_MAGIC_SIZE] != 0 - || (s->temp.buf[HEADER_MAGIC_SIZE + 1] > 1 - && s->temp.buf[HEADER_MAGIC_SIZE + 1] != 0x04 - && s->temp.buf[HEADER_MAGIC_SIZE + 1] != 0x0A - ) + || (s->temp.buf[HEADER_MAGIC_SIZE + 1] > 1 + && s->temp.buf[HEADER_MAGIC_SIZE + 1] != 0x04 /* CRC64 */ + && s->temp.buf[HEADER_MAGIC_SIZE + 1] != 0x0A /* SHA-256 */ + ) ) { - XZ_DEBUG_MSG("unsupported stream flags %x:%x", - s->temp.buf[HEADER_MAGIC_SIZE], - s->temp.buf[HEADER_MAGIC_SIZE+1]); return XZ_OPTIONS_ERROR; } @@ -435,10 +433,7 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) #else if (s->temp.buf[1] & 0x3F) #endif - { - XZ_DEBUG_MSG("s->temp.buf[1] & 0x3E/3F != 0"); return XZ_OPTIONS_ERROR; - } /* Compressed Size */ if (s->temp.buf[1] & 0x40) { @@ -466,10 +461,8 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) /* If there are two filters, the first one must be a BCJ filter. */ s->bcj_active = s->temp.buf[1] & 0x01; if (s->bcj_active) { - if (s->temp.size - s->temp.pos < 2) { - XZ_DEBUG_MSG("temp.size - temp.pos < 2"); + if (s->temp.size - s->temp.pos < 2) return XZ_OPTIONS_ERROR; - } ret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]); if (ret != XZ_OK) @@ -479,10 +472,8 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) * We don't support custom start offset, * so Size of Properties must be zero. */ - if (s->temp.buf[s->temp.pos++] != 0x00) { - XZ_DEBUG_MSG("size of properties != 0"); + if (s->temp.buf[s->temp.pos++] != 0x00) return XZ_OPTIONS_ERROR; - } } #endif @@ -491,16 +482,12 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) return XZ_DATA_ERROR; /* Filter ID = LZMA2 */ - if (s->temp.buf[s->temp.pos++] != 0x21) { - XZ_DEBUG_MSG("filter ID != 0x21"); + if (s->temp.buf[s->temp.pos++] != 0x21) return XZ_OPTIONS_ERROR; - } /* Size of Properties = 1-byte Filter Properties */ - if (s->temp.buf[s->temp.pos++] != 0x01) { - XZ_DEBUG_MSG("size of properties != 1"); + if (s->temp.buf[s->temp.pos++] != 0x01) return XZ_OPTIONS_ERROR; - } /* Filter Properties contains LZMA2 dictionary size. */ if (s->temp.size - s->temp.pos < 1) @@ -512,10 +499,8 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) /* The rest must be Header Padding. */ while (s->temp.pos < s->temp.size) - if (s->temp.buf[s->temp.pos++] != 0x00) { - XZ_DEBUG_MSG("padding is not zero-filled"); + if (s->temp.buf[s->temp.pos++] != 0x00) return XZ_OPTIONS_ERROR; - } s->temp.pos = 0; s->block.compressed = 0; |