Test case to reproduce bug:
Copy first 7 bytes (any number of bytes will do), then change first byte (press a random key), go to file end, paste-overwrite (Ctrl+B)
=> HxD will hang
Related bug test case:
Copy first 7 bytes (any number of bytes will do), change nothing!, go to file end, paste-overwrite (Ctrl+B)
=> Listindex error
HxD sometimes hangs when past-writing at file end
Re: HxD sometimes hangs when past-writing at file end
I get the error on empty document using CTRL+B
Hang where there is data
I don't need to change any first byte content, just CTRL+B near -or at end of document so some bytes won't fit inside current docuiment size = Hang
CTRL+V is fine as it ADDS to any document, but your idea of CTRL+B seems to be a "overwriting only inside current sized document", well ofcourse any CTRL+B will cause error (when catchable) of hang when not, when adding data beyond last byte, your function should make sure the copy buffer fits inside the document without making it larger if that's the point, or best: overwrite till end of document and ADD the remaining if that's what's wanted.
Cheers
Hang where there is data
I don't need to change any first byte content, just CTRL+B near -or at end of document so some bytes won't fit inside current docuiment size = Hang
CTRL+V is fine as it ADDS to any document, but your idea of CTRL+B seems to be a "overwriting only inside current sized document", well ofcourse any CTRL+B will cause error (when catchable) of hang when not, when adding data beyond last byte, your function should make sure the copy buffer fits inside the document without making it larger if that's the point, or best: overwrite till end of document and ADD the remaining if that's what's wanted.
Cheers
Re: HxD sometimes hangs when past-writing at file end
The bug is a bit more complicated than that, it will expand the document/EditStream when necessary, of course, but related datastructures that monitor this change don't get updated properly.
Thanks for the additional test case. It is a special case of the second test case in my first post (which also does not modify the file before Ctrl+B). Mine makes sure to have a defined clipboard content first (that can be pasted, i.e., has the right format), and also goes to the file end (which is not necessary for an empty file).
But it's good to have an additional simplified test case, as well.
Thanks for the additional test case. It is a special case of the second test case in my first post (which also does not modify the file before Ctrl+B). Mine makes sure to have a defined clipboard content first (that can be pasted, i.e., has the right format), and also goes to the file end (which is not necessary for an empty file).
But it's good to have an additional simplified test case, as well.