Skip to content

Commit 53353de

Browse files
msizanoen1bluca
authored andcommitted
test-escape: Add tests for escaping bogus UTF-8 sequences
(cherry picked from commit 582843e) (cherry picked from commit c4e7cf2) (cherry picked from commit dec5e2e) (cherry picked from commit 11ecf66)
1 parent fb016a1 commit 53353de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/test/test-escape.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ TEST(shell_maybe_quote) {
196196

197197
test_shell_maybe_quote_one("głąb\002\003rząd", 0, "\"głąb\\002\\003rząd\"");
198198
test_shell_maybe_quote_one("głąb\002\003rząd", SHELL_ESCAPE_POSIX, "$'głąb\\002\\003rząd'");
199+
200+
/* Bogus UTF-8 strings */
201+
test_shell_maybe_quote_one("\250\350", 0, "\"\\250\\350\"");
202+
test_shell_maybe_quote_one("\250\350", SHELL_ESCAPE_POSIX, "$'\\250\\350'");
199203
}
200204

201205
static void test_quote_command_line_one(char **argv, const char *expected) {

0 commit comments

Comments
 (0)