Skip to content

Commit

Permalink
fuzzing: set LC_ALL=C when running GNU printf
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker committed Feb 17, 2024
1 parent 420dfe8 commit 89bad85
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fuzz/fuzz_targets/fuzz_printf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 10,7 @@ use uu_printf::uumain;

use rand::seq::SliceRandom;
use rand::Rng;
use std::env;
use std::ffi::OsString;

mod fuzz_common;
Expand Down Expand Up @@ -82,6 83,8 @@ fuzz_target!(|_data: &[u8]| {
args.extend(printf_input.split_whitespace().map(OsString::from));
let rust_result = generate_and_run_uumain(&args, uumain, None);

// TODO remove once uutils printf supports localization
env::set_var("LC_ALL", "C");
let gnu_result = match run_gnu_cmd(CMD_PATH, &args[1..], false, None) {
Ok(result) => result,
Err(error_result) => {
Expand Down

0 comments on commit 89bad85

Please sign in to comment.