From 8f4732acbc50f75d5de0e58558759f0096e274cf Mon Sep 17 00:00:00 2001 From: Naim A Date: Fri, 12 Jul 2013 00:09:47 +0300 Subject: [PATCH] Security issue fixed. Issue 4 fixed. --- src/udpTracker.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/udpTracker.cpp b/src/udpTracker.cpp index 7e88552..a067177 100644 --- a/src/udpTracker.cpp +++ b/src/udpTracker.cpp @@ -161,6 +161,10 @@ namespace UDPT msg_sz = 4 + 4 + 1 + msg.length(); + // test against overflow message. resolves issue 4. + if (msg_sz > 1024) + return -1; + memcpy(buff, &error, 8); for (i = 8;i <= msg_sz;i++) {