tuner-simple: possible read buffer overflow?
PATCH 1/1 tuner-simple: possible read buffer overflow?
Prevent read from t_params->ranges[-1].
Signed-off-by Roel Kluin <[email protected]>
---
This is only required when t_params->count can be 0, can it?
Roel
drivers/media/common/tuners/tuner-simple.c +1 -1
@@ -266,7 +266,7 @@ static int simple_config_lookup(struct dvb_frontend *fe,continue ;break ; } -if (i == t_params->count) { +if (i == t_params->count && i) {tuner_dbg ("frequency out of range (%d > %d)\n" , *frequency, t_params->ranges[i -1 ].limit); *frequency = t_params->ranges[--i].limit;
Quoted 5 lines · Roel Kluin
Prevent read from t_params->ranges[-1].
Signed-off-by Roel Kluin <[email protected]>---
This is only required whent_params->countcan be 0, can it?
Shouldn't be possible, or the tuner would be useless.
Quoted 5 lines
drivers/media/common/tuners/tuner-simple.c +1
-1-if (i == t_params->count) { +if (i == t_params->count && i) {tuner_dbg ("frequency out of range (%d > %d)\n" , *frequency, t_params->ranges[i -1 ].limit); *frequency = t_params->ranges[--i].limit;