summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gix <bgix@codeaurora.org>2011-02-19 12:45:43 -0800
committerJohan Hedberg <johan.hedberg@nokia.com>2011-02-20 15:26:43 -0300
commit8fc0ba539dc411059824424026b6d41b1c7e3cfc (patch)
treea42d5f21d97071a4ee72be0e5463cd167f54d9c5
parent646cc43be8b0153b0cadcb2933f635f1ea143715 (diff)
Fix crash where MTU allowed to be set too large
As previously written, a remote device could request, and we would accept an MTU larger than what we could support.
-rw-r--r--src/attrib-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 6966ad028..4285f6e2c 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -639,7 +639,7 @@ static uint16_t write_value(struct gatt_channel *channel, uint16_t handle,
static uint16_t mtu_exchange(struct gatt_channel *channel, uint16_t mtu,
uint8_t *pdu, int len)
{
- channel->mtu = MIN(mtu, ATT_MAX_MTU);
+ channel->mtu = MIN(mtu, channel->mtu);
return enc_mtu_resp(channel->mtu, pdu, len);
}