1
0
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:
Martine Lenders 2020-09-22 15:51:05 +02:00 committed by GitHub
commit db6355fb13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)