You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (track != 0 && sector != 0) {
/* more T/S lists to come, so we keep all entries */
tsCount += kMaxTSPairs;
} else {
/* this was the last one */
When it actually wanted to do:
if (track != 0) {
The existing code thinks it has reached the end of all T/S lists when the sector number of the next T/S link is zero. As a result, if you have a file large enough to require at least 3 T/S lists, and one of the early T/S lists happens to live in sector 0 of a track, the T/S extractor will have a shortened count.
It doesn't actually stop copying entries into the output array, it just uses the wrong value for the count. The count is used to set the output array position, so the later entries overwrite the earlier entries in the array, and you end up losing a 122*256-byte chunk out of the middle of the file.
Sample image that demonstrates the issue with a sparse text file: cp-ts-bug.zip
The text was updated successfully, but these errors were encountered:
DOS33.cpp's
LoadTSList()
function does this:When it actually wanted to do:
The existing code thinks it has reached the end of all T/S lists when the sector number of the next T/S link is zero. As a result, if you have a file large enough to require at least 3 T/S lists, and one of the early T/S lists happens to live in sector 0 of a track, the T/S extractor will have a shortened count.
It doesn't actually stop copying entries into the output array, it just uses the wrong value for the count. The count is used to set the output array position, so the later entries overwrite the earlier entries in the array, and you end up losing a 122*256-byte chunk out of the middle of the file.
Sample image that demonstrates the issue with a sparse text file: cp-ts-bug.zip
The text was updated successfully, but these errors were encountered: