TomHarte / dsk2woz

A command-line tool to convert Apple II DSK images to WOZ format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Buffer overrun in encode_6_and_2()

tomcw opened this issue · comments

commented

This code overruns at location==1:

	while(location) {
		--location;
		dest[location] ^= dest[location-1];
	}

So should be:

	while(location>1) {
		--location;
		dest[location] ^= dest[location-1];
	}

I built with VS2017 (and VS2008) and it creates broken .woz images, as the 1st nibble of each sector is wrong.

Thanks, sorry for not noticing this earlier. You're completely right, corrected.