From a3d8a5aa94c5643a1aa725bb7ae0f44b16b28511 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 18 Mar 2012 00:51:43 +0100 Subject: [PATCH] midori_view_save_source needs to handle data == NULL Fixes: https://bugs.launchpad.net/midori/+bug/957674 --- midori/midori-view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 0a957055..f038ca7b 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -5232,7 +5232,7 @@ midori_view_save_source (MidoriView* view, { if ((fp = fdopen (fd, "w"))) { - ret = fwrite (data->str, 1, data->len, fp); + ret = fwrite (data ? data->str : "", 1, data ? data->len : 0, fp); fclose (fp); if ((ret - data->len) != 0) { -- 2.39.5