[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnu-libiconv] [bug #58903] assert gentranslit buffer-overflow
From: |
Pascal Cuoq |
Subject: |
[bug-gnu-libiconv] [bug #58903] assert gentranslit buffer-overflow |
Date: |
Wed, 5 Aug 2020 15:25:51 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15 |
Follow-up Comment #3, bug #58903 (project libiconv):
> the malloc reserves 2 for this, so the assert extends it up to 99
Note that technically, the assert as written does not guard against printing
100 in:
assert (i < 100);
sprintf(s, "%02x_%d", p, ++i);
I would also question the wisdom of using assert(), which can be disabled at
pre-processing, for a safety check, but that could be argued to be a question
of style.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58903>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/