mhl: mhl_shell_unescape_buf(): fixed memory array OOB.

Function misbehaves whe input string ends with backslash.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
This commit is contained in:
Sergei Trofimovich 2009-02-01 14:01:12 +02:00
parent ad1abaebfb
commit 7a51b50d5c

View File

@ -113,6 +113,8 @@ static inline char* mhl_shell_unescape_buf(char* text)
case '`':
case '"':
case ';':
case '\0': /* end of line! malformed escape string */
goto out;
default:
(*writeptr) = c; writeptr++; break;
}
@ -124,6 +126,7 @@ static inline char* mhl_shell_unescape_buf(char* text)
}
readptr++;
}
out:
*writeptr = 0;
return text;