1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-26 16:45:12 -04: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:
Miciah Dashiel Butler Masters 2007-12-01 19:31:23 +00:00
parent 7f5bada6b4
commit a2bc397350

View File

@ -142,7 +142,6 @@ document_info_dialog(struct session *ses)
struct terminal *term = ses->tab->term;
struct location *location = cur_loc(ses);
struct document_view *doc_view;
struct cache_entry *cached;
struct string msg;
if (!location) {
@ -169,8 +168,8 @@ document_info_dialog(struct session *ses)
add_char_to_string(&msg, '\n');
cached = doc_view->document->cached;
if (cached) {
if (doc_view && doc_view->document->cached) {
struct cache_entry *cached = doc_view->document->cached;
unsigned char *a;
add_format_to_string(&msg, "\n%s: %" OFF_T_FORMAT,