diff options
author | Theodore Ts'o <tytso@mit.edu> | 2022-08-10 22:48:13 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2022-08-10 22:48:13 -0400 |
commit | aa5732531f76e405a17415a4217f86cf8270d589 (patch) | |
tree | e347d16753bb141cab1555737849992c97956982 | |
parent | 5308fc1ee5a1e2b402f099fcc0c445387b91a01d (diff) | |
download | e2fsprogs-aa5732531f76e405a17415a4217f86cf8270d589.tar.gz |
e2fsck: handle invalid percent expansions in the log filename
Add a missing default: case when expanding percent expansions in the
log file specified in /etc/e2fsck.conf.
Addresses-Coverity-Bug: 1500757
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | e2fsck/logfile.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/e2fsck/logfile.c b/e2fsck/logfile.c index 7bdeae190..9d79eed2c 100644 --- a/e2fsck/logfile.c +++ b/e2fsck/logfile.c @@ -155,6 +155,9 @@ static void expand_percent_expression(e2fsck_t ctx, char ch, case 'Y': sprintf(buf, "%d", tm->tm_year + 1900); break; + default: + sprintf(buf, "%%%c", ch); + break; } append_string(s, buf, 0); } |