vte-0.28.2-limit-arguments.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From feeee4b5832b17641e505b7083e0d299fdae318e Mon Sep 17 00:00:00 2001
  2. From: Christian Persch <chpe@gnome.org>
  3. Date: Sat, 19 May 2012 17:36:09 +0000
  4. Subject: emulation: Limit integer arguments to 65535
  5. To guard against malicious sequences containing excessively big numbers,
  6. limit all parsed numbers to 16 bit range. Doing this here in the parsing
  7. routine is a catch-all guard; this doesn't preclude enforcing
  8. more stringent limits in the handlers themselves.
  9. https://bugzilla.gnome.org/show_bug.cgi?id=676090
  10. ---
  11. diff --git a/src/table.c b/src/table.c
  12. index 140e8c8..85cf631 100644
  13. --- a/src/table.c
  14. +++ b/src/table.c
  15. @@ -550,7 +550,7 @@ _vte_table_extract_numbers(GValueArray **array,
  16. if (G_UNLIKELY (*array == NULL)) {
  17. *array = g_value_array_new(1);
  18. }
  19. - g_value_set_long(&value, total);
  20. + g_value_set_long(&value, CLAMP (total, 0, G_MAXUSHORT));
  21. g_value_array_append(*array, &value);
  22. } while (i++ < arginfo->length);
  23. g_value_unset(&value);
  24. diff --git a/src/vteseq.c b/src/vteseq.c
  25. index 457c06a..46def5b 100644
  26. --- a/src/vteseq.c
  27. +++ b/src/vteseq.c
  28. @@ -557,7 +557,7 @@ vte_sequence_handler_multiple(VteTerminal *terminal,
  29. GValueArray *params,
  30. VteTerminalSequenceHandler handler)
  31. {
  32. - vte_sequence_handler_multiple_limited(terminal, params, handler, G_MAXLONG);
  33. + vte_sequence_handler_multiple_limited(terminal, params, handler, G_MAXUSHORT);
  34. }
  35. static void
  36. --
  37. cgit v0.9.0.2