From: Lasse Collin Date: Tue, 26 May 2026 16:30:29 +0000 (+0300) Subject: xz: Use tuklib_mbstr_nonprint in a few more places X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=7e7bb6c21cf9;p=thirdparty%2Fxz.git xz: Use tuklib_mbstr_nonprint in a few more places Reported-by: GitHub user curious-rabbit --- diff --git a/src/xz/args.c b/src/xz/args.c index c32ee5c1..bc7a5e8b 100644 --- a/src/xz/args.c +++ b/src/xz/args.c @@ -75,7 +75,8 @@ parse_block_list(const char *str_const) // It must be non-empty and not begin with a comma. if (str[0] == '\0' || str[0] == ',') - message_fatal(_("%s: Invalid argument to --block-list"), str); + message_fatal(_("%s: Invalid argument to --block-list"), + tuklib_mask_nonprint(str)); // Count the number of comma-separated strings. size_t count = 1; @@ -86,7 +87,7 @@ parse_block_list(const char *str_const) // Prevent an unlikely integer overflow. if (count > SIZE_MAX / sizeof(block_list_entry) - 1) message_fatal(_("%s: Too many arguments to --block-list"), - str); + tuklib_mask_nonprint(str)); // Allocate memory to hold all the sizes specified. // If --block-list was specified already, its value is forgotten. @@ -562,7 +563,8 @@ parse_real(args_info *args, int argc, char **argv) if (++i == ARRAY_SIZE(types)) message_fatal(_("%s: Unknown file " "format type"), - optarg); + tuklib_mask_nonprint( + optarg)); opt_format = types[i].format; break; @@ -584,15 +586,16 @@ parse_real(args_info *args, int argc, char **argv) while (strcmp(types[i].str, optarg) != 0) { if (++i == ARRAY_SIZE(types)) message_fatal(_("%s: Unsupported " - "integrity " - "check type"), optarg); + "integrity check type"), + tuklib_mask_nonprint(optarg)); } // Use a separate check in case we are using different // liblzma than what was used to compile us. if (!lzma_check_is_supported(types[i].check)) - message_fatal(_("%s: Unsupported integrity " - "check type"), optarg); + message_fatal(_("%s: Unsupported " + "integrity check type"), + tuklib_mask_nonprint(optarg)); coder_set_check(types[i].check); break; @@ -645,8 +648,9 @@ parse_real(args_info *args, int argc, char **argv) // TRANSLATORS: This is a translatable // string because French needs a space // before the colon ("%s : %s"). - message_fatal(_("%s: %s"), optarg, - strerror(errno)); + message_fatal(_("%s: %s"), + tuklib_mask_nonprint(optarg), + strerror(errno)); } break; diff --git a/src/xz/coder.c b/src/xz/coder.c index c28f874a..92e35622 100644 --- a/src/xz/coder.c +++ b/src/xz/coder.c @@ -172,7 +172,7 @@ str_to_filters(const char *str, uint32_t index, uint32_t flags) // the messages are included in xz's translations. message(V_ERROR, _("Error in --filters%s=FILTERS option:"), filter_num); - message(V_ERROR, "%s", str); + message(V_ERROR, "%s", tuklib_mask_nonprint(str)); message(V_ERROR, "%*s^", error_pos, ""); message_fatal("%s", _(err)); } diff --git a/src/xz/util.c b/src/xz/util.c index bb9b86ad..06b774d0 100644 --- a/src/xz/util.c +++ b/src/xz/util.c @@ -111,7 +111,7 @@ str_to_uint64(const char *name, const char *value, uint64_t min, uint64_t max) return max; if (*value < '0' || *value > '9') - message_fatal(_("%s: %s"), value, + message_fatal(_("%s: %s"), tuklib_mask_nonprint(value), _("Value is not a non-negative decimal integer")); do {