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
@@ -239,6 +239,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"); @@ -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"); @@ -220,6 +220,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"); |