openssl-CVE-2009-1377.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. diff -Nura openssl-0.9.8l/crypto/pqueue/pqueue.c openssl-0.9.8l-CVE-2009-1377/crypto/pqueue/pqueue.c
  2. --- openssl-0.9.8l/crypto/pqueue/pqueue.c 2005-06-28 09:53:33.000000000 -0300
  3. +++ openssl-0.9.8l-CVE-2009-1377/crypto/pqueue/pqueue.c 2009-11-10 13:19:42.000000000 -0300
  4. @@ -234,3 +234,17 @@
  5. return ret;
  6. }
  7. +
  8. +int
  9. +pqueue_size(pqueue_s *pq)
  10. +{
  11. + pitem *item = pq->items;
  12. + int count = 0;
  13. +
  14. + while(item != NULL)
  15. + {
  16. + count++;
  17. + item = item->next;
  18. + }
  19. + return count;
  20. +}
  21. diff -Nura openssl-0.9.8l/crypto/pqueue/pqueue.h openssl-0.9.8l-CVE-2009-1377/crypto/pqueue/pqueue.h
  22. --- openssl-0.9.8l/crypto/pqueue/pqueue.h 2005-05-30 19:34:27.000000000 -0300
  23. +++ openssl-0.9.8l-CVE-2009-1377/crypto/pqueue/pqueue.h 2009-11-10 13:19:42.000000000 -0300
  24. @@ -91,5 +91,6 @@
  25. pitem *pqueue_next(piterator *iter);
  26. void pqueue_print(pqueue pq);
  27. +int pqueue_size(pqueue pq);
  28. #endif /* ! HEADER_PQUEUE_H */
  29. diff -Nura openssl-0.9.8l/ssl/d1_pkt.c openssl-0.9.8l-CVE-2009-1377/ssl/d1_pkt.c
  30. --- openssl-0.9.8l/ssl/d1_pkt.c 2009-11-05 12:21:28.000000000 -0300
  31. +++ openssl-0.9.8l-CVE-2009-1377/ssl/d1_pkt.c 2009-11-10 13:19:42.000000000 -0300
  32. @@ -167,6 +167,10 @@
  33. DTLS1_RECORD_DATA *rdata;
  34. pitem *item;
  35. + /* Limit the size of the queue to prevent DOS attacks */
  36. + if (pqueue_size(queue->q) >= 100)
  37. + return 0;
  38. +
  39. rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA));
  40. item = pitem_new(priority, rdata);
  41. if (rdata == NULL || item == NULL)