Pau Espin Pedrol has submitted this change and it was merged.

Change subject: osmux: Fix buffer overflow in osmux_snprintf
......................................................................


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
---
M src/osmux.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
 }
 
 #define SNPRINTF_BUFFER_SIZE(ret, size, len, offset)   \
-       size += ret;                                    \
+       size -= ret;                                    \
        if (ret > len)                                  \
                ret = len;                              \
        offset += ret;                                  \

-- 
To view, visit https://gerrit.osmocom.org/3521
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>

Reply via email to