notepad.exe considered harmful
This is totally incredible. I knew that Microsoft rarely practised defensive programming (I guess they're too busy being defensive in front of EU tribunals), but this is just so incredibly amusing!
Thanks to the tipoff from The Inquirer, here is the fun:

Under Windows (I used an up to date XP, may apply to other versions), open Notepad and create a one line document with the text "this app can break". It is presumably "specially crafted" to exploit a particular issue (apparently a weakness in some sort of encoding guessing algorithm). Eg:

Save the document and quit Notepad. Now open the document you saved by double-clicking it, and you will be rewarded with a message that possibly contains the secrets of an ancient Japanese martial art:
Just incredible. And there are nuclear warships powered by software from this vendor? I sure won't be following that ancient Japanese master who entrusted his secrets to Windows! I don't think this one can be stamped as this is by design ;)
Update: Before anyone says "but I bet they don't use notepad.exe on the battelships (heh - I bet they do), Aftermarket Pipes has found that the "limitation" is not in notepad.exe, but in a Microsoft Windows API call that is used to determine what encoding the file uses. It turns out that a lot of Unicode files don't start with the BOM (byte order mark) required by the Unicode standard. So you can do one of two things: encourage software developers to adhere to the standard and everyone wins except for a few (possibly vocal) firms that have a poorly designed piece of custom Windows software. Or MS can include a hack like this in their standard API and encourage most developers (including ones at MS it seems) to ignore the standard and create yet more backward compatibility issues for future MS developers to have to deal with (and then ship Vista even later).
Of course another option would be to have a filesystem and OS that (properly) supported metadata for each file. Unfortunately the only mainstream OS that did that well was classic MacOS. Current OSX "best" practise is to not use the resource fork.
01:25 PM, 16 Jun 2006 by Mark Aufflick Permalink