diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-02-22 20:08:41 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-02-22 20:08:41 +0100 |
commit | 637cb958d33bf0b6ad70c2411631d685bffcfdbe (patch) | |
tree | bef6288ffdd828069222036206f28b53fadb0ba8 | |
parent | 20876adf568c31ec6c446892ce8b6e2f650f5035 (diff) |
dvb-fe-tool: better check the event type
The test condition is allowing to use a value bigger than
the size of the event_type. Fix it.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | utils/dvb/dvb-fe-tool.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/dvb/dvb-fe-tool.c b/utils/dvb/dvb-fe-tool.c index 6cd89157..92b90905 100644 --- a/utils/dvb/dvb-fe-tool.c +++ b/utils/dvb/dvb-fe-tool.c @@ -301,7 +301,7 @@ static const char * const event_type[] = { static int dev_change_monitor(char *sysname, enum dvb_dev_change_type type, void *user_priv) { - if (type > ARRAY_SIZE(event_type)) + if (type >= ARRAY_SIZE(event_type)) printf("unknown event on device %s\n", sysname); else printf("device %s was %s\n", sysname, event_type[type]); |