From ac30bc33268ce171969b1b34af848d7d3d374708 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Mon, 9 Sep 2019 18:27:21 +0200 Subject: [PATCH] src/pxar/decoder.rs: correctly read, check and skip filename The previous implementation simply skipped over `size` bytes, which is not correct as size includes also the header. By relying on `SequentailDecoder`s read_filename function, this is correctly taken care of plus some more integrity checks. Signed-off-by: Christian Ebner --- src/pxar/decoder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pxar/decoder.rs b/src/pxar/decoder.rs index be151cf1..2ef600f8 100644 --- a/src/pxar/decoder.rs +++ b/src/pxar/decoder.rs @@ -305,7 +305,7 @@ impl Result<(), Error>> Decoder { if marker == PXAR_FILENAME { let size: u64 = self.inner.read_item()?; - let _bytes = self.inner.skip_bytes(usize::try_from(size)?)?; + let _filename = self.inner.read_filename(size)?; marker = self.inner.read_item()?; } if marker != PXAR_ENTRY {