Let’s dive into a peculiar bug in iOS. And by that I mean, let’s follow along as Guilherme Rambo dives into a peculiar bug in iOS.
The bug is that, if you try to send an audio message using the Messages app to someone who’s also using the Messages app, and that message happens to include the name “Dave and Buster’s”, the message will never be received.
↫ Guilherme Rambo
As I read this first description of the bug, I had no idea what could possibly be causing this. However, once Rambo explained that every audio message is transcribed by Apple into a text version, I immediately assumed what was going on: that “and” is throwing up problems because the actual name of the brand is stylised with an ampersand, isn’t it? It’s always DNS HTML, isn’t it?
Yes. Yes it is.
↫ Guilherme Rambo
MessagesBlastDoorService
usesMBDXMLParserContext
(viaMBDHTMLToSuperParserContext
) to parse XHTML for the audio message. Ampersands have special meaning in XML/HTML and must be escaped, so the correct way to represent the transcription in HTML would have been"Dave & Buster's"
. Apple’s transcription system is not doing that, causing the parser to attempt to detect a special code after the ampersand, and since there’s no valid special code nor semicolon terminating what it thinks is an HTML entity, it detects an error and stops parsing the content.
It must be somewhat of a relief to programmers and developers the world over that even a company as large and filled with talented people as Apple can run into bugs like this.
Somewhere there’s a sub-reddit just for all the lonely blokes who invited their dates to Dave & Busters for marriage proposals but were stood up. Oddly enough they are also all Arch Linux users.
Did anyone else see name “Dave and Buster’s” and see the apostrophe as suspect? They are responsible for SQL injection vulnerabilities…
https://xkcd.com/327/
Funny joke, but in all seriousness unescaped names containing apostrophes really do cause SQL errors.
I wonder if apple’s code has more errors beyond ‘&’ such as ‘<‘
I thought it would be the apostrophe too.