From 160deb44650e03be96d773e3acc411ad7f7a7e6c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 27 Feb 2022 23:19:49 -0800 Subject: [PATCH] tcpproxy: fix Wformat warning snprintf call requires one more byte for NULL termunator. Signed-off-by: Rosen Penev --- net/tcpproxy/Makefile | 2 +- net/tcpproxy/patches/010-format.patch | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 net/tcpproxy/patches/010-format.patch diff --git a/net/tcpproxy/Makefile b/net/tcpproxy/Makefile index e56e8ad87a..0fc0364029 100644 --- a/net/tcpproxy/Makefile +++ b/net/tcpproxy/Makefile @@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tcpproxy PKG_VERSION:=1.2 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.spreadspace.org/tcpproxy/releases/ diff --git a/net/tcpproxy/patches/010-format.patch b/net/tcpproxy/patches/010-format.patch new file mode 100644 index 0000000000..a681999eae --- /dev/null +++ b/net/tcpproxy/patches/010-format.patch @@ -0,0 +1,11 @@ +--- a/src/log.c ++++ b/src/log.c +@@ -244,7 +244,7 @@ void log_print_hex_dump(log_prio_t prio, + for(i=0; i < len; i++) { + if(((i+1)*3) >= (MSG_LENGTH_MAX - offset)) + break; +- snprintf(ptr, 3, "%02X ", buf[i]); ++ snprintf(ptr, 4, "%02X ", buf[i]); + ptr+=3; + } + }