d1_pkt.c (194206) | d1_pkt.c (196474) |
---|---|
1/* ssl/d1_pkt.c */ 2/* 3 * DTLS implementation written by Nagendra Modadugu 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 */ 6/* ==================================================================== 7 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. 8 * --- 153 unchanged lines hidden (view full) --- 162 163 164static int 165dtls1_buffer_record(SSL *s, record_pqueue *queue, PQ_64BIT priority) 166{ 167 DTLS1_RECORD_DATA *rdata; 168 pitem *item; 169 | 1/* ssl/d1_pkt.c */ 2/* 3 * DTLS implementation written by Nagendra Modadugu 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 */ 6/* ==================================================================== 7 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. 8 * --- 153 unchanged lines hidden (view full) --- 162 163 164static int 165dtls1_buffer_record(SSL *s, record_pqueue *queue, PQ_64BIT priority) 166{ 167 DTLS1_RECORD_DATA *rdata; 168 pitem *item; 169 |
170 /* Limit the size of the queue to prevent DOS attacks */ 171 if (pqueue_size(queue->q) >= 100) 172 return 0; 173 |
|
170 rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA)); 171 item = pitem_new(priority, rdata); 172 if (rdata == NULL || item == NULL) 173 { 174 if (rdata != NULL) OPENSSL_free(rdata); 175 if (item != NULL) pitem_free(item); 176 177 SSLerr(SSL_F_DTLS1_BUFFER_RECORD, ERR_R_INTERNAL_ERROR); --- 1615 unchanged lines hidden --- | 174 rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA)); 175 item = pitem_new(priority, rdata); 176 if (rdata == NULL || item == NULL) 177 { 178 if (rdata != NULL) OPENSSL_free(rdata); 179 if (item != NULL) pitem_free(item); 180 181 SSLerr(SSL_F_DTLS1_BUFFER_RECORD, ERR_R_INTERNAL_ERROR); --- 1615 unchanged lines hidden --- |