mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-20 14:03:59 +08:00
Trust the passed size in escape_string_script
This allows it to handle NULs.
This commit is contained in:
parent
ba69f8f71d
commit
338b40bb43
|
@ -943,7 +943,7 @@ static void escape_string_script(const wchar_t *orig_in, size_t in_len, wcstring
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*in != 0) {
|
for (size_t i = 0; i < in_len; i++) {
|
||||||
if ((*in >= ENCODE_DIRECT_BASE) && (*in < ENCODE_DIRECT_BASE + 256)) {
|
if ((*in >= ENCODE_DIRECT_BASE) && (*in < ENCODE_DIRECT_BASE + 256)) {
|
||||||
int val = *in - ENCODE_DIRECT_BASE;
|
int val = *in - ENCODE_DIRECT_BASE;
|
||||||
int tmp;
|
int tmp;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user