diff options
| author | James Youngman <jay@gnu.org> | 2013-09-24 00:28:05 +0100 |
|---|---|---|
| committer | James Youngman <jay@gnu.org> | 2013-09-24 00:28:05 +0100 |
| commit | cdd390b492d7e9db18a1e9aa88e42525ce4022e5 (patch) | |
| tree | 10b7494e2328432a348898c46497caaf523c048b | |
| parent | 4f45698bc3a7b547debd135ab5969f1ec1b65ea0 (diff) | |
| download | findutils-cdd390b492d7e9db18a1e9aa88e42525ce4022e5.tar.gz | |
Fix bug #39162: -printf reads beyond arguments terminated by \
* find/print.c (insert_fprintf): If a \ is found at the end of a
format string, issue a warning (and render it as-is).
* NEWS: Mention this bugfix.
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | NEWS | 4 | ||||
| -rw-r--r-- | find/print.c | 8 |
3 files changed, 16 insertions, 1 deletions
@@ -1,5 +1,10 @@ 2013-09-23 James Youngman <jay@gnu.org> + Fix bug #39162: -printf reads beyond arguments terminated by \ + * find/print.c (insert_fprintf): If a \ is found at the end of a + format string, issue a warning (and render it as-is). + * NEWS: Mention this bugfix. + Update version number to 4.5.13-git. * configure.ac: Update version number to 4.5.13-git. * NEWS: Likewise. @@ -2,6 +2,10 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout) * Major changes in release 4.5.13-git, 2013-MM-DD +** Bug Fixes + +#39162: -printf reads beyond arguments terminated by \ + ** Translations Updated translations: Estonian, Polish, Ukranian. diff --git a/find/print.c b/find/print.c index 5d35172..ae1b8c3 100644 --- a/find/print.c +++ b/find/print.c @@ -341,7 +341,13 @@ insert_fprintf (struct format_val *vec, else if (*fmt_editpos == '\\') { size_t readpos = 1; - if (is_octal_char(fmt_editpos[readpos])) + if (!fmt_editpos[readpos]) + { + error (0, 0, _("warning: escape `\\' followed by nothing at all")); + --readpos; + /* (*fmt_editpos) is already '\\' and that's a reasonable result. */ + } + else if (is_octal_char(fmt_editpos[readpos])) { size_t consumed = 0; *fmt_editpos = parse_octal_escape(fmt_editpos + readpos, &consumed); |
