From 7eeeea81c74c7184984510892871fd79406c0393 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 10 Nov 2021 10:28:37 +0000 Subject: lei q: disallow "\n" in argv[] elements I don't expect this to be hit in real-world use via normal interactive shells. However, somebody could accidentally add "\n" in languages (e.g. Perl, C) where it's easy to pass "\n" in argv[]. --- lib/PublicInbox/LeiQuery.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm index 352ee601..51ee3d9c 100644 --- a/lib/PublicInbox/LeiQuery.pm +++ b/lib/PublicInbox/LeiQuery.pm @@ -141,6 +141,7 @@ no query allowed on command-line with --stdin PublicInbox::InputPipe::consume($self->{0}, \&qstr_add, $self); return; } + chomp(@argv) and $self->qerr("# trailing `\\n' removed"); $mset_opt{q_raw} = [ @argv ]; # copy $mset_opt{qstr} = $self->{lse}->query_argv_to_string($self->{lse}->git, \@argv); -- cgit v1.2.3-24-ge0c7