diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2016-04-27 11:25:36 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2016-04-27 14:09:16 +0300 |
commit | 61bad31ced4deb82647b94cae58e0aaeeff27a7e (patch) | |
tree | cd8d4e33c5874b51b9ea364c8272d341c0f89d83 /monitor/control.c | |
parent | 065e286b640f84402b1a8970218a75154000b020 (diff) | |
download | bluez-61bad31ced4deb82647b94cae58e0aaeeff27a7e.tar.gz |
monitor: Fix checking for sufficient data
Diffstat (limited to 'monitor/control.c')
-rw-r--r-- | monitor/control.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/monitor/control.c b/monitor/control.c index 508b06896..710b97595 100644 --- a/monitor/control.c +++ b/monitor/control.c @@ -1062,11 +1062,11 @@ static void client_callback(int fd, uint32_t events, void *user_data) data->offset += len; - if (data->offset > MGMT_HDR_SIZE) { + if (data->offset >= MGMT_HDR_SIZE) { struct mgmt_hdr *hdr = (struct mgmt_hdr *) data->buf; uint16_t pktlen = le16_to_cpu(hdr->len); - if (data->offset > pktlen + MGMT_HDR_SIZE) { + if (data->offset >= pktlen + MGMT_HDR_SIZE) { uint16_t opcode = le16_to_cpu(hdr->opcode); uint16_t index = le16_to_cpu(hdr->index); |