diff options
-rw-r--r-- | dtls.c | 4 | ||||
-rw-r--r-- | tcp.c | 4 | ||||
-rw-r--r-- | tls.c | 4 |
3 files changed, 12 insertions, 0 deletions
@@ -235,6 +235,10 @@ unsigned char *raddtlsget(SSL *ssl, struct gqueue *rbios, int timeout) { } len = RADLEN(buf); + if (len < 4) { + debug(DBG_ERR, "raddtlsget: length too small"); + continue; + } rad = malloc(len); if (!rad) { debug(DBG_ERR, "raddtlsget: malloc failed"); @@ -169,6 +169,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"); @@ -216,6 +216,10 @@ unsigned char *radtlsget(SSL *ssl, int timeout) { } len = RADLEN(buf); + if (len < 4) { + debug(DBG_ERR, "radtlsget: length too small"); + continue; + } rad = malloc(len); if (!rad) { debug(DBG_ERR, "radtlsget: malloc failed"); |