Fix off-by-one which caused BZ #18042 and add a test for it.

This commit is contained in:
Paul Pluzhnikov 2015-03-08 21:55:13 -07:00
parent 36103ba2f5
commit f8ba70e9f8
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2015-03-09 Paul Pluzhnikov <ppluzhnikov@google.com>
[BZ #18042]
* posix/wordexp.c (parse_backtick): Fix off-by-one.
* posix/wordexp-test.c (test_case): Add test for BZ #18042.
2015-03-09 Paul Pluzhnikov <ppluzhnikov@google.com>
[BZ #18043]

View File

@ -234,7 +234,8 @@ struct test_case_struct
{ WRDE_CMDSUB, NULL, "$((1+`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS },
{ WRDE_CMDSUB, NULL, "$((1+$((`echo 1`))))", WRDE_NOCMD, 0, { NULL, }, IFS },
{ WRDE_SYNTAX, NULL, "${", 0, 0, { NULL, }, IFS }, /* BZ 18043 */
{ WRDE_SYNTAX, NULL, "`\\", 0, 0, { NULL, }, IFS }, /* BZ 18042 */
{ WRDE_SYNTAX, NULL, "${", 0, 0, { NULL, }, IFS }, /* BZ 18043 */
{ -1, NULL, NULL, 0, 0, { NULL, }, IFS },
};

View File

@ -2143,7 +2143,6 @@ parse_backtick (char **word, size_t *word_length, size_t *max_length,
break;
}
++(*offset);
error = parse_backslash (&comm, &comm_length, &comm_maxlen, words,
offset);