From e0e9b30f5cbda675b5504caab88654d89fa47cae Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 25 Aug 2014 10:05:31 +0200 Subject: tx_power.c: fix potential array out-of-bounds access --- src/common/tx_power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/tx_power.c b/src/common/tx_power.c index be96c3d3..862450bb 100644 --- a/src/common/tx_power.c +++ b/src/common/tx_power.c @@ -33,7 +33,7 @@ static int get_pa_drive_level_mdBm(const struct power_amp *pa, int desired_p_out_mdBm, unsigned int arfcn) { - if (arfcn > ARRAY_SIZE(pa->calib.gain_mdB)) + if (arfcn >= ARRAY_SIZE(pa->calib.gain_mdB)) return INT_MIN; /* FIXME: temperature compensation */ -- cgit v1.2.3