[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-323-g65b78c0c8
wwp at claws-mail.org
wwp at claws-mail.org
Wed Oct 6 12:02:36 CEST 2021
The branch, gtk3 has been updated
via 65b78c0c8a3dbae0cbb315a3dc75f83c0e3f16fa (commit)
from 1803265b185cb02c3e6b57e569e4e7653c8541d9 (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 65b78c0c8a3dbae0cbb315a3dc75f83c0e3f16fa
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 6d6eedc6a..20d11619c 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