summaryrefslogtreecommitdiffstats
path: root/ssl/d1_pkt.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-05-16 16:17:46 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-05-16 16:17:46 +0000
commit88b48dc68024dcc437da4296c9fb04419b0ccbe1 (patch)
tree392e81ba55e2579d65d5da2a78d92e914ebc2c48 /ssl/d1_pkt.c
parent661d35dfb20e4f696fb03e373020367f9306f36c (diff)
PR: 1930
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Approved by: steve@openssl.org Limit size of DTLS record buffer queue.
Diffstat (limited to 'ssl/d1_pkt.c')
-rw-r--r--ssl/d1_pkt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
index b53e07d23c..a89edbc7a7 100644
--- a/ssl/d1_pkt.c
+++ b/ssl/d1_pkt.c
@@ -207,6 +207,10 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority)
DTLS1_RECORD_DATA *rdata;
pitem *item;
+ /* Limit the size of the queue to prevent DOS attacks */
+ if (pqueue_size(queue->q) >= 100)
+ return 0;
+
rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA));
item = pitem_new(priority, rdata);
if (rdata == NULL || item == NULL)