mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Fix NULL-dereference in document_info_dialog if document not yet loaded
It was possible to cause a crash by opening the Document Info box at the right moment during the loading of a document.
This commit is contained in:
parent
7f5bada6b4
commit
a2bc397350
@ -142,7 +142,6 @@ document_info_dialog(struct session *ses)
|
|||||||
struct terminal *term = ses->tab->term;
|
struct terminal *term = ses->tab->term;
|
||||||
struct location *location = cur_loc(ses);
|
struct location *location = cur_loc(ses);
|
||||||
struct document_view *doc_view;
|
struct document_view *doc_view;
|
||||||
struct cache_entry *cached;
|
|
||||||
struct string msg;
|
struct string msg;
|
||||||
|
|
||||||
if (!location) {
|
if (!location) {
|
||||||
@ -169,8 +168,8 @@ document_info_dialog(struct session *ses)
|
|||||||
|
|
||||||
add_char_to_string(&msg, '\n');
|
add_char_to_string(&msg, '\n');
|
||||||
|
|
||||||
cached = doc_view->document->cached;
|
if (doc_view && doc_view->document->cached) {
|
||||||
if (cached) {
|
struct cache_entry *cached = doc_view->document->cached;
|
||||||
unsigned char *a;
|
unsigned char *a;
|
||||||
|
|
||||||
add_format_to_string(&msg, "\n%s: %" OFF_T_FORMAT,
|
add_format_to_string(&msg, "\n%s: %" OFF_T_FORMAT,
|
||||||
|
Loading…
Reference in New Issue
Block a user