Skip to content

Commit 3759bcd

Browse files
author
Kevin Moloney
committed
Fix Klocwork#2051,2060: Array may be outside index
Change && to || Signed-off-by: Kevin Moloney <kevin.moloney@emutex.com>
1 parent 5baa3fc commit 3759bcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/CurieBle/src/BleCharacteristic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ BleCharacteristic::_setValue(void)
165165
if (!_initialised)
166166
return BLE_STATUS_WRONG_STATE;
167167

168-
if ((_data_len > BLE_MAX_ATTR_DATA_LEN) && (_data_len > _char_data.max_len))
168+
if ((_data_len > BLE_MAX_ATTR_DATA_LEN) || (_data_len > _char_data.max_len))
169169
return BLE_STATUS_NOT_ALLOWED;
170170

171171
status = ble_client_gatts_set_attribute_value(_handles.value_handle,

0 commit comments

Comments
 (0)