aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-14 17:19:55 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-08-14 17:24:11 +0200
commit7cca0da1cc58bd589989684147ae3a0cd5819902 (patch)
tree2bb01fd9ce7e65fcbc63fe305953b3c7345f32cc
parent6032a35be84c87607e295e46f1e37d3dd4e5f1b1 (diff)
osmux: Fix buffer overflow in osmux_snprintf
When running osmux_test on my PC, the process was aborted with a "stack smashing detected" error. Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0
-rw-r--r--src/osmux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmux.c b/src/osmux.c
index 23a6440..2481d6a 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -847,7 +847,7 @@ void osmux_xfrm_output_init(struct osmux_out_handle *h, uint32_t rtp_ssrc)
}
#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \
- size += ret; \
+ size -= ret; \
if (ret > len) \
ret = len; \
offset += ret; \