diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-12-28 14:34:52 +0100 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2018-12-28 23:58:07 +0100 |
commit | 785ecc9e50f6da846089936f0683e2ef0a27e3f5 (patch) | |
tree | 2e7498a6b3575c2185e74a7026088f0b5fac5035 /src/gsm/gsm0411_smc.c | |
parent | 470221575deaa14c670a5d4233df80119599141d (diff) |
logging/gsmtap: fix buffer overflow in _gsmtap_raw_output()
According to the man page, vsnprintf() returns:
- a negative value in case of error;
- the number of characters written (excluding '\0');
- the number of characters which *would have been written*
if enough space had been available (excluding '\0').
We need to detect if the output was truncated, and properly
limit the amount of bytes to be reserved within a msgb.
Change-Id: Ifa822edf900ed925ba935c54a28c797c4657358a
Diffstat (limited to 'src/gsm/gsm0411_smc.c')
0 files changed, 0 insertions, 0 deletions