From 5ca04071b14af6261c797551bcf26a3851ebbae8 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 16 Jan 2015 16:44:04 +0100 Subject: Fix heap overflow in raddtlsget(), radtcpget() and radtlsget(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Stephen Röttger. --- tcp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index 6de39fc..515acbf 100644 --- a/tcp.c +++ b/tcp.c @@ -173,6 +173,10 @@ unsigned char *radtcpget(int s, int timeout) { } len = RADLEN(buf); + if (len < 4) { + debug(DBG_ERR, "radtcpget: length too small"); + continue; + } rad = malloc(len); if (!rad) { debug(DBG_ERR, "radtcpget: malloc failed"); -- cgit v1.1