From 875268d4aa615a93f15c35e6a0331599bbdb0928 Mon Sep 17 00:00:00 2001 From: aib Date: Fri, 15 Jul 2022 09:29:47 +0300 Subject: [PATCH] Fix FileScanner calling tell on unseekable streams --- pcapng/structs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcapng/structs.py b/pcapng/structs.py index ec7b887..21b2f86 100644 --- a/pcapng/structs.py +++ b/pcapng/structs.py @@ -255,7 +255,7 @@ def read_bytes_padded(stream, size, pad_block_size=4): were read """ - if stream.tell() % pad_block_size != 0: + if stream.seekable() and (stream.tell() % pad_block_size != 0): raise RuntimeError("Stream is misaligned!") data = read_bytes(stream, size)