aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-25 10:05:31 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-25 10:05:55 +0200
commite0e9b30f5cbda675b5504caab88654d89fa47cae (patch)
treeda9c1564abad442db96c7093abcb66d106140a78
parent68b9b376cf6d3a983cc6b06d7aef189c30b952f2 (diff)
tx_power.c: fix potential array out-of-bounds access
-rw-r--r--src/common/tx_power.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/tx_power.c b/src/common/tx_power.c
index be96c3d..862450b 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 */