libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 819353c26d0c995b456bdbbcbd8c815999e22c1a
parent c77549b64b74c2dbc43fd6ca482e5862424ec063
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 30 Jun 2026 18:52:03 +0200

re-compute length properly as buffer refill might have changed it if less than 8 bytes were left

Diffstat:
Msrc/plugins/real_extractor.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/plugins/real_extractor.c b/src/plugins/real_extractor.c @@ -517,6 +517,10 @@ extract_real (struct EXTRACTOR_ExtractContext *ec, size = isize; off = noff; pos = 0; + /* re-read the atom header from the freshly filled buffer; + the previous value of 'length' refers to the old buffer + (or was never assigned due to short-circuit evaluation) */ + length = ntohl (((uint32_t *) (data + pos))[1]); } if (length <= 8) return;