From edc5efcac2fcad40dd14100954457939545a7132 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 15 Mar 2022 00:00:00 -0500 Subject: [PATCH] top: add another tiny bit of robustness to rcfile code At this point I don't know if the Rc.id ever carried a value of 'b', 'c', 'd' or 'e' in a public release. But I do know that those values ought not to be recognized in any configuration file. Now they won't be for sure. [ while the absence of this new check didn't produce ] [ an error message, it would skip the initialization ] [ of default values plus possible string extensions. ] Signed-off-by: Jim Warner --- top/top.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/top/top.c b/top/top.c index 0dc55581..edd3b38f 100644 --- a/top/top.c +++ b/top/top.c @@ -4048,6 +4048,8 @@ static const char *configs_file (FILE *fp, const char *name, float *delay) { } if (Rc.id < 'a' || Rc.id > RCF_VERSION_ID) return p; + if (strchr("bcde", Rc.id)) + return p; if (Rc.mode_altscr < 0 || Rc.mode_altscr > 1) return p; if (Rc.mode_irixps < 0 || Rc.mode_irixps > 1) -- 2.40.0