From: Christian Dywan Date: Sat, 17 Mar 2012 23:51:43 +0000 (+0100) Subject: midori_view_save_source needs to handle data == NULL X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3d8a5aa94c5643a1aa725bb7ae0f44b16b28511;p=midori midori_view_save_source needs to handle data == NULL Fixes: https://bugs.launchpad.net/midori/+bug/957674 --- 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) {