[PATCH] libosmo-netif[master]: osmux: Fix buffer overflow in osmux_snprintf

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Aug 14 17:13:12 UTC 2017


Review at  https://gerrit.osmocom.org/3521

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


  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/21/3521/1

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: newchange
Gerrit-Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list