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.

26 lines
974 B

  1. commit eb72c1faedc39c68fb1246ea8a97d1f96831756c
  2. Author: Willy Tarreau <w@1wt.eu>
  3. Date: Mon Oct 15 11:12:15 2018 +0200
  4. BUILD: stick-table: make sure not to fail on task_new() during initialization
  5. Gcc reports a potential null-deref error in the stick-table init code.
  6. While not critical there, it's trivial to fix. This check has been
  7. missing since 1.4 so this fix can be backported to all supported versions.
  8. (cherry picked from commit 848522f05df9e60eea9274e11f1e9fcd19594a5c)
  9. Signed-off-by: Willy Tarreau <w@1wt.eu>
  10. diff --git a/src/stick_table.c b/src/stick_table.c
  11. index 5a2f1295..653a1ffb 100644
  12. --- a/src/stick_table.c
  13. +++ b/src/stick_table.c
  14. @@ -602,6 +602,8 @@ int stktable_init(struct stktable *t)
  15. t->exp_next = TICK_ETERNITY;
  16. if ( t->expire ) {
  17. t->exp_task = task_new(MAX_THREADS_MASK);
  18. + if (!t->exp_task)
  19. + return 0;
  20. t->exp_task->process = process_table_expire;
  21. t->exp_task->context = (void *)t;
  22. }