]> spindle.queued.net Git - midori/commitdiff
midori_view_save_source needs to handle data == NULL
authorChristian Dywan <christian@twotoasts.de>
Sat, 17 Mar 2012 23:51:43 +0000 (00:51 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sun, 18 Mar 2012 08:32:32 +0000 (09:32 +0100)
Fixes: https://bugs.launchpad.net/midori/+bug/957674
midori/midori-view.c

index 0a957055ba29c131bef972f92e91fb37b7e580b1..f038ca7b90f059b7b3a4822faae2bfe47bfb7531 100644 (file)
@@ -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)
             {