This repository has no description

Fix large OSC 8 links causing memory corruption (#5666) master

Fixes #5635 ### Changes: - Added handling to `Screen.adjustCapacity` which properly returns an error if there's no room for the cursor hyperlink. Note the TODO, in the future we should probably make it handle this by increasing the capacity further. - Added handling to `Screen.cursorSetHyperlink` which ensures there will be sufficient capacity to add the redundant cursor hyperlink to the string alloc after adjusting the capacity. ***Future work:** Aside from separating the cursor's managed memory from the page memory, which is a big thing we desperately need, we should probably also make the page string alloc intern the strings it gets to deduplicate.* - Fixed a slight bug in the OSC parser which was causing the hyperlink command to be issued with an empty (0-length) URI when the buffer capacity was exceeded during an OSC 8 sequence. ***Future work:** We should consider increasing the `MAX_BUF` since some specs call for a max size of 4096 (such as various Kitty protocols) -- otherwise we should switch all the OSCs that can take arbitrary data like this to use the allocator instead of the fixed buffer.* - Fixed a problem where when cloning content across pages (as happened every time we had to adjust page capacities) hyperlinks would not be properly looked up, often leading to many many redundant copies of a given URI being stored, exploding string memory.