summaryrefslogtreecommitdiff
path: root/dtls.c
diff options
context:
space:
mode:
Diffstat (limited to 'dtls.c')
-rw-r--r--dtls.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dtls.c b/dtls.c
index 8be677e..f866092 100644
--- a/dtls.c
+++ b/dtls.c
@@ -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");