mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #15054 from haukepetersen/fix_emcute_msgupdate
net/emcute: fix buffer overflow in _willupd_msg()
This commit is contained in:
commit
db6355fb13
@ -483,11 +483,10 @@ int emcute_willupd_msg(const void *data, size_t len)
|
||||
mutex_lock(&txlock);
|
||||
|
||||
size_t pos = set_len(tbuf, (len + 1));
|
||||
len += (pos + 1);
|
||||
tbuf[pos++] = WILLMSGUPD;
|
||||
memcpy(&tbuf[pos], data, len);
|
||||
|
||||
return syncsend(WILLMSGRESP, len, true);
|
||||
return syncsend(WILLMSGRESP, (pos + len), true);
|
||||
}
|
||||
|
||||
void emcute_run(uint16_t port, const char *id)
|
||||
|
Loading…
Reference in New Issue
Block a user