зеркало из
https://git.tukaani.org/xz.git
synced 2025-10-23 01:22:55 +00:00
xzgrep: Make the fix for ZDI-CAN-16587 more robust.
I don't know if this can make a difference in the real world but it looked kind of suspicious (what happens with sed implementations that cannot process very long lines?). At least this commit shouldn't make it worse.
Этот коммит содержится в:
родитель
bd7b290f3f
Коммит
a648978b20
@ -223,7 +223,10 @@ for i; do
|
|||||||
case $i in
|
case $i in
|
||||||
(*'
|
(*'
|
||||||
'* | *'&'* | *'\'* | *'|'*)
|
'* | *'&'* | *'\'* | *'|'*)
|
||||||
i=$(printf '%s\n' "$i" | LC_ALL=C sed 's/[&\|]/\\&/g; $!s/$/\\/');;
|
# If sed fails, set i to a known safe string to ensure that
|
||||||
|
# failing sed didn't create a half-escaped dangerous string.
|
||||||
|
i=$(printf '%s\n' "$i" | LC_ALL=C sed 's/[&\|]/\\&/g; $!s/$/\\/') ||
|
||||||
|
i='(unknown filename):';;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# $i already ends with a colon so don't add it here.
|
# $i already ends with a colon so don't add it here.
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user