Cover last potential corner case with mixers, should be totally safe now

This commit is contained in:
Lorenz Meier
2013-09-22 11:16:19 +02:00
parent 669d4c6dd2
commit f62aeba420
3 changed files with 32 additions and 4 deletions
+6
View File
@@ -142,6 +142,12 @@ NullMixer *
NullMixer::from_text(const char *buf, unsigned &buflen)
{
NullMixer *nm = nullptr;
const char *end = buf + buflen;
/* require a space or newline at the end of the buffer */
if (*end != ' ' && *end != '\n' && *end != '\r') {
return nm;
}
if ((buflen >= 2) && (buf[0] == 'Z') && (buf[1] == ':')) {
nm = new NullMixer;