diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-07-08 13:25:54 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-07-08 13:25:54 +0100 |
commit | 89a02c3a8fa8b386224e531118c82a6a76332229 (patch) | |
tree | c8dc1eefc71af1f5b1fbe076b50333c43e4cbd77 /desktop/save_complete.c | |
parent | 5ce4f11eac7fae76fe2965f92daf2910f80eb6a1 (diff) | |
download | netsurf-89a02c3a8fa8b386224e531118c82a6a76332229.tar.gz netsurf-89a02c3a8fa8b386224e531118c82a6a76332229.tar.bz2 |
when walking the css imports ensure the content is present before dereferencing it
css import entries may not have a valid content if the resource failed to load
or was unsuitable in some otehr way. The save_complete iterator did not cope with this.
fixes #2166
Diffstat (limited to 'desktop/save_complete.c')
-rw-r--r-- | desktop/save_complete.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/desktop/save_complete.c b/desktop/save_complete.c index f6d3e7664..71187eb10 100644 --- a/desktop/save_complete.c +++ b/desktop/save_complete.c @@ -355,8 +355,11 @@ static bool save_complete_save_imported_sheets(save_complete_ctx *ctx, uint32_t i; for (i = 0; i < import_count; i++) { - if (save_complete_save_stylesheet(ctx, imports[i].c) == false) - return false; + /* treat a valid content as a stylesheet to save */ + if ((imports[i].c != NULL) && + (save_complete_save_stylesheet(ctx, imports[i].c) == false)) { + return false; + } } return true; |