[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bindat can exhaust memory when unpacking to vector
From: |
Petteri Hintsanen |
Subject: |
Re: Bindat can exhaust memory when unpacking to vector |
Date: |
Sun, 12 Nov 2023 21:11:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Kind of an embarrassing blind spot. BinDat should instead encourage the
> addition of sanity checks within the parsing code (including maybe add
> specific support for it).
This was also something I had in mind, along the lines of what Tomas
wrote below:
<tomas@tuxteam.de> writes:
> OTOH, a maximum length of something might be thought as a (n optional)
> part of a type description. Types are predicates.
>
> As could be a set of bounds for a numerical type. Perhaps there's an
> extension opportunity for bindat.
So yes, I also agree that this could be an extension opportunity, but I
wouldn't push it further until we have concrete use cases. It is
usually futile to try to generalize from zero examples. (Well, I do
have one example, but still.)
For the time being using inline checks within the specification suffices
for me.
Thanks,
Petteri