mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
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:
parent
ad1abaebfb
commit
7a51b50d5c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user