mgmtops: Check for exact mgmt_device_found event size

This commit is contained in:
Johan Hedberg 2011-12-19 13:53:07 +02:00
parent 42a03e1c6f
commit 4d155a809b

View File

@ -1244,8 +1244,9 @@ static void mgmt_device_found(int sk, uint16_t index, void *buf, size_t len)
uint8_t *eir;
uint32_t cls;
if (len < sizeof(*ev)) {
error("Too small mgmt_device_found event packet");
if (len != sizeof(*ev)) {
error("mgmt_device_found length %u instead of expected %u",
len, sizeof(*ev));
return;
}