3 ms·
Forbidden characters can occur in other string representations, like length + data. Escape sequences are higher level syntax being represented by the string; t
by kazinator 8y ago
Forbidden characters can occur in other string representations, like length + data.
Escape sequences are higher level syntax being represented by the string; they don't belong in the string representation.
A transfer encoding like UTF-8 isn't a string representation either.
Manipulation of syntaxes and encodings stored in character strings can be buggy. The representation does contribute to the risk. E.g. if a UTF-8 decoder doesn't reject overlong forms, then a null character can be encoded in the middle of the data so that to the buggy function or program, it looks like a different string from one that was validated earlier.