Loading crypto/pqueue/pqueue.c +14 −0 Original line number Diff line number Diff line Loading @@ -237,3 +237,17 @@ pqueue_next(pitem **item) return ret; } int pqueue_size(pqueue_s *pq) { pitem *item = pq->items; int count = 0; while(item != NULL) { count++; item = item->next; } return count; } crypto/pqueue/pqueue.h +1 −0 Original line number Diff line number Diff line Loading @@ -89,5 +89,6 @@ pitem *pqueue_iterator(pqueue pq); pitem *pqueue_next(piterator *iter); void pqueue_print(pqueue pq); int pqueue_size(pqueue pq); #endif /* ! HEADER_PQUEUE_H */ ssl/d1_pkt.c +4 −0 Original line number Diff line number Diff line Loading @@ -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) Loading Loading
crypto/pqueue/pqueue.c +14 −0 Original line number Diff line number Diff line Loading @@ -237,3 +237,17 @@ pqueue_next(pitem **item) return ret; } int pqueue_size(pqueue_s *pq) { pitem *item = pq->items; int count = 0; while(item != NULL) { count++; item = item->next; } return count; }
crypto/pqueue/pqueue.h +1 −0 Original line number Diff line number Diff line Loading @@ -89,5 +89,6 @@ pitem *pqueue_iterator(pqueue pq); pitem *pqueue_next(piterator *iter); void pqueue_print(pqueue pq); int pqueue_size(pqueue pq); #endif /* ! HEADER_PQUEUE_H */
ssl/d1_pkt.c +4 −0 Original line number Diff line number Diff line Loading @@ -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) Loading