0001-harden-link-checker-before-accepting-click.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From ac286a71ed78429e16c612161251b9ea90ccd431 Mon Sep 17 00:00:00 2001
  2. From: Paul <paul@claws-mail.org>
  3. Date: Sun, 23 May 2021 12:16:40 +0100
  4. Subject: [PATCH] harden link checker before accepting click
  5. [Retrieved from:
  6. https://git.claws-mail.org/?p=claws.git;a=commit;h=ac286a71ed78429e16c612161251b9ea90ccd431]
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. ---
  9. src/textview.c | 4 +++-
  10. 1 file changed, 3 insertions(+), 1 deletion(-)
  11. diff --git a/src/textview.c b/src/textview.c
  12. index 62ad46eaf..3cdf5d911 100644
  13. --- a/src/textview.c
  14. +++ b/src/textview.c
  15. @@ -2885,7 +2885,7 @@ gboolean textview_uri_security_check(TextView *textview, ClickableText *uri)
  16. gboolean retval = TRUE;
  17. if (is_uri_string(uri->uri) == FALSE)
  18. - return TRUE;
  19. + return FALSE;
  20. visible_str = textview_get_visible_uri(textview, uri);
  21. if (visible_str == NULL)
  22. @@ -2922,6 +2922,8 @@ gboolean textview_uri_security_check(TextView *textview, ClickableText *uri)
  23. if (aval == G_ALERTALTERNATE)
  24. retval = TRUE;
  25. }
  26. + if (strlen(uri->uri) > get_uri_len(uri->uri))
  27. + retval = FALSE;
  28. g_free(visible_str);
  29. --
  30. 2.25.1