diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2022-07-17 21:36:25 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2022-07-17 21:36:25 +0300 |
commit | 6a4a4a7d2667837dc824c26fcb19ed6ca5aff645 (patch) | |
tree | 7473724eef5a7812d8e632a9719b1f1857093411 /src/common | |
parent | xzgrep: Fix parsing of certain options. (diff) | |
download | xz-6a4a4a7d2667837dc824c26fcb19ed6ca5aff645.tar.xz |
xzgrep: Add more LC_ALL=C to avoid bugs with multibyte characters.
Also replace one use of expr with printf.
The rationale for LC_ALL=C was already mentioned in
69d1b3fc29677af8ade8dc15dba83f0589cb63d6 that fixed a security
issue. However, unrelated uses weren't changed in that commit yet.
POSIX says that with sed and such tools one should use LC_ALL=C
to ensure predictable behavior when strings contain byte sequences
that aren't valid multibyte characters in the current locale. See
under "Application usage" in here:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
With GNU sed invalid multibyte strings would work without this;
it's documented in its Texinfo manual. Some other implementations
aren't so forgiving.
Diffstat (limited to 'src/common')
0 files changed, 0 insertions, 0 deletions