4 ms·
I worked on health record software. An elusive bug in the custom SQL Server crypto plugin led to very occasional corrupted entries, which was very bad. The guy
by mbrock 10y ago
I worked on health record software. An elusive bug in the custom SQL Server crypto plugin led to very occasional corrupted entries, which was very bad.
The guy who wrote the crypto plugin had of course quit and nobody knew how it worked.
Fine-combing the C++, I found an off-by-one error that would cause the predicted failures: after rebooting SQL Server, the first entry would get encrypted with a zero key. (Hooray, we could now also fix all the corrupted data.)
For various reasons it would have been difficult to ship new DLLs to the affected customers. Only a handful used this particular crypto and it would be much easier to patch the existing binary DLLs on their servers.
Well... looking at the machine code, I found that the troublesome off-by-one operations were actually in the printable ASCII range... so I just taught my friend in tech support to do a particular obscure search and replace in Notepad++, something like changing ",}" into ",~" in the binary DLL... and then hot-reload it with an SQL Server command... worked perfectly.
- obituary_latte 10y agoNice! Must have made that tech feel and look like a hero :)
- tobiaswk 10y agoWhat a great little story. Thanks for sharing!