tar: avoid read overrun

Problem reported by Timotej Kapus in:
https://lists.gnu.org/r/bug-tar/2020-05/msg00001.html
* src/transform.c (parse_transform_expr):
Diagnose ‘--transform='s'’ instead of continuing past '\0'.
This commit is contained in:
Paul Eggert
2020-05-19 11:52:01 -07:00
parent 41654f91f0
commit dd1a6bd37a

View File

@@ -208,6 +208,8 @@ parse_transform_expr (const char *expr)
}
delim = expr[1];
if (!delim)
USAGE_ERROR ((0, 0, _("Invalid transform expression")));
/* Scan regular expression */
for (i = 2; expr[i] && expr[i] != delim; i++)