From 0459a8a090028ccf56336f7ee0b0ba9344789398 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 6 Nov 2019 22:04:02 -0500 Subject: [PATCH] Correct buffer overrun, as reported by TomCh. Resolves #4. --- dsk2woz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsk2woz.c b/dsk2woz.c index 29fb700..452f0bc 100755 --- a/dsk2woz.c +++ b/dsk2woz.c @@ -342,7 +342,7 @@ static void encode_6_and_2(uint8_t *dest, const uint8_t *src) { // Exclusive OR each byte with the one before it. dest[342] = dest[341]; size_t location = 342; - while(location) { + while(location > 1) { --location; dest[location] ^= dest[location-1]; }