diff options
author | June McEnroe <june@causal.agency> | 2018-02-14 22:01:48 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2018-02-14 22:01:48 -0500 |
commit | 3397b6f86d7d3563a8f6ea43ae395bc3a7acb609 (patch) | |
tree | 61819afc1cefae6a2c612f64a22bf6d830b43528 | |
parent | Print PNG path on gfxx dump (diff) | |
download | src-3397b6f86d7d3563a8f6ea43ae395bc3a7acb609.tar.gz src-3397b6f86d7d3563a8f6ea43ae395bc3a7acb609.zip |
Avoid accessing past last byte in gfxx
Diffstat (limited to '')
-rw-r--r-- | bin/gfxx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/gfxx.c b/bin/gfxx.c index 50568c0d..72fe64b8 100644 --- a/bin/gfxx.c +++ b/bin/gfxx.c @@ -271,7 +271,7 @@ static void drawBits(struct Iter *it) { static void drawBytes(struct Iter *it) { uint8_t bytes = (BITS_TOTAL + 7) / 8; - for (size_t i = offset; i < size; i += bytes) { + for (size_t i = offset; i + bytes <= size; i += bytes) { uint32_t n = 0; for (size_t b = 0; b < bytes; ++b) { n <<= 8; |