提交 6dac3447 编写于 作者: D Dan Carpenter 提交者: John W. Linville

p54: potential signedness issue in p54_parse_rssical()

"entries" is unsigned here, so it is never less than zero.  In theory,
len could be less than offset so I have added a check for that.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NChristian Lamparter <chunkeey@googlemail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 06ef5c4b
......@@ -541,8 +541,9 @@ static int p54_parse_rssical(struct ieee80211_hw *dev,
entries = (len - offset) /
sizeof(struct pda_rssi_cal_ext_entry);
if ((len - offset) % sizeof(struct pda_rssi_cal_ext_entry) ||
entries <= 0) {
if (len < offset ||
(len - offset) % sizeof(struct pda_rssi_cal_ext_entry) ||
entries == 0) {
wiphy_err(dev->wiphy, "invalid rssi database.\n");
goto err_data;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册