You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

  1. From 1e89acb6be9ba6400fe4defd3b6b2cc94c6667d9 Mon Sep 17 00:00:00 2001
  2. From: Willy Tarreau <w@1wt.eu>
  3. Date: Wed, 26 Nov 2014 13:24:24 +0100
  4. Subject: [PATCH 2/2] BUG/MEDIUM: payload: ensure that a request channel is
  5. available
  6. Denys Fedoryshchenko reported a segfault when using certain
  7. sample fetch functions in the "tcp-request connection" rulesets
  8. despite the warnings. This is because some tests for the existence
  9. of the channel were missing.
  10. The fetches which were fixed are :
  11. - req.ssl_hello_type
  12. - rep.ssl_hello_type
  13. - req.ssl_sni
  14. This fix must be backported to 1.5.
  15. (cherry picked from commit 83f2592bcd2e186beeabcba16be16faaab82bd39)
  16. ---
  17. src/payload.c | 6 ++++++
  18. 1 file changed, 6 insertions(+)
  19. diff --git a/src/payload.c b/src/payload.c
  20. index 4057f6f..f62163c 100644
  21. --- a/src/payload.c
  22. +++ b/src/payload.c
  23. @@ -72,6 +72,9 @@ smp_fetch_ssl_hello_type(struct proxy *px, struct session *s, void *l7, unsigned
  24. chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? s->rep : s->req;
  25. + if (!chn)
  26. + goto not_ssl_hello;
  27. +
  28. bleft = chn->buf->i;
  29. data = (const unsigned char *)chn->buf->p;
  30. @@ -276,6 +279,9 @@ smp_fetch_ssl_hello_sni(struct proxy *px, struct session *s, void *l7, unsigned
  31. chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? s->rep : s->req;
  32. + if (!chn)
  33. + goto not_ssl_hello;
  34. +
  35. bleft = chn->buf->i;
  36. data = (unsigned char *)chn->buf->p;
  37. --
  38. 2.0.4