[Commits] [SCM] claws branch, master, updated. 3.18.0-261-g3d29bbb7d

wwp at claws-mail.org wwp at claws-mail.org
Wed Oct 6 12:02:29 CEST 2021


The branch, master has been updated
       via  3d29bbb7dfa9914a0a671251ae9b8ee971b1f998 (commit)
      from  8f03bca61aca398d2fb3733bde7c17990aab174e (commit)

Summary of changes:
 src/plugins/litehtml_viewer/container_linux_images.cpp |  7 ++-----
 src/plugins/litehtml_viewer/lh_viewer.c                | 14 ++++++++------
 2 files changed, 10 insertions(+), 11 deletions(-)


- Log -----------------------------------------------------------------
commit 3d29bbb7dfa9914a0a671251ae9b8ee971b1f998
Author: wwp <subscript at free.fr>
Date:   Wed Oct 6 12:02:24 2021 +0200

    Fix CID 1491104, 1491132, 1491327: dereference before null check.

diff --git a/src/plugins/litehtml_viewer/container_linux_images.cpp b/src/plugins/litehtml_viewer/container_linux_images.cpp
index e45db3bf2..7efa413d6 100644
--- a/src/plugins/litehtml_viewer/container_linux_images.cpp
+++ b/src/plugins/litehtml_viewer/container_linux_images.cpp
@@ -33,9 +33,8 @@ static GdkPixbuf *lh_get_image(const litehtml::tchar_t* url)
 {
 	GError *error = NULL;
 	GdkPixbuf *pixbuf = NULL;
-	http* http_loader = NULL;
 
-	http_loader = new http();
+	http* http_loader = new http();
 	GInputStream *image = http_loader->load_url(url, &error);
 
 	if (error || !image) {
@@ -56,9 +55,7 @@ static GdkPixbuf *lh_get_image(const litehtml::tchar_t* url)
 	}
 
 theend:
-	if (http_loader) {
-		delete http_loader;
-	}
+	delete http_loader;
 
 	return pixbuf;
 }
diff --git a/src/plugins/litehtml_viewer/lh_viewer.c b/src/plugins/litehtml_viewer/lh_viewer.c
index e8bd07760..cd9cd693c 100644
--- a/src/plugins/litehtml_viewer/lh_viewer.c
+++ b/src/plugins/litehtml_viewer/lh_viewer.c
@@ -144,24 +144,26 @@ static void lh_print_viewer (MimeViewer *_viewer)
 static gboolean lh_scroll_page(MimeViewer *_viewer, gboolean up)
 {
 	LHViewer *viewer = (LHViewer *)_viewer;
-	GtkAdjustment *vadj = gtk_scrolled_window_get_vadjustment(
-					GTK_SCROLLED_WINDOW(lh_widget_get_widget(viewer->widget)));
+	GtkAdjustment *vadj = NULL;
 
-	if (viewer->widget == NULL)
+	if (!viewer || (viewer->widget == NULL))
 		return FALSE;
 
+	vadj = gtk_scrolled_window_get_vadjustment(
+				GTK_SCROLLED_WINDOW(lh_widget_get_widget(viewer->widget)));
 	return gtkutils_scroll_page(lh_widget_get_widget(viewer->widget), vadj, up);
 }
 
 static void lh_scroll_one_line(MimeViewer *_viewer, gboolean up)
 {
 	LHViewer *viewer = (LHViewer *)_viewer;
-	GtkAdjustment *vadj = gtk_scrolled_window_get_vadjustment(
-					GTK_SCROLLED_WINDOW(lh_widget_get_widget(viewer->widget)));
+	GtkAdjustment *vadj = NULL;
 
-	if (viewer->widget == NULL)
+	if (!viewer || (viewer->widget == NULL))
 		return;
 
+	vadj = gtk_scrolled_window_get_vadjustment(
+					GTK_SCROLLED_WINDOW(lh_widget_get_widget(viewer->widget)));
 	gtkutils_scroll_one_line(lh_widget_get_widget(viewer->widget), vadj, up);
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list