Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* src/pathx.c (parse_name): correctly handle trailing whitespace in n…
…ames When a name ended in whitespace, we incorrectly assumed it was always ok to trim that whitespace. That is not true if that whitespace is escaped, i.e. if the path expression is something like '/x\ '. In that case, the name really needs to be literally 'x ', i.e., we can not trim that whitespace. The incorrect behavior led to turning '/x\ ' first into 'x\' and then, because we assume that '\' is always followed by a character inside the string, when we removed the escaping '\', we would read beyond the end of the intermediate string result; if we were lucky, that would lead to a crash, otherwise we'd continue with junk. We now make sure that escaped whitespace at the end of a string does not get stripped, avoiding all these headaches. Fixes RHBZ https://bugzilla.redhat.com/show_bug.cgi?id=1475621
- Loading branch information
Showing
2 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters