diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-11-17 10:33:09 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-11-17 10:33:09 +0000 |
commit | ecfdcbe1131591502c5e7f9ff4f34b24c5a2db97 (patch) | |
tree | 7e504022fdb982f55c80f423fa510c0c74b865de | |
parent | Update ChangeLog (diff) | |
download | w3m-ecfdcbe1131591502c5e7f9ff4f34b24c5a2db97.tar.gz w3m-ecfdcbe1131591502c5e7f9ff4f34b24c5a2db97.zip |
Prevent deref null pointer in HTMLlineproc0()
Bug-Debian: https://github.com/tats/w3m/issues/42
-rw-r--r-- | file.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -6330,10 +6330,10 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) while (*line != '\0') { char *str, *p; int is_tag = FALSE; - int pre_mode = (obuf->table_level >= 0) ? tbl_mode->pre_mode : - obuf->flag; - int end_tag = (obuf->table_level >= 0) ? tbl_mode->end_tag : - obuf->end_tag; + int pre_mode = (obuf->table_level >= 0 && tbl_mode) ? + tbl_mode->pre_mode : obuf->flag; + int end_tag = (obuf->table_level >= 0 && tbl_mode) ? + tbl_mode->end_tag : obuf->end_tag; if (*line == '<' || obuf->status != R_ST_NORMAL) { /* @@ -6415,7 +6415,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) } proc_normal: - if (obuf->table_level >= 0) { + if (obuf->table_level >= 0 && tbl && tbl_mode) { /* * within table: in <table>..</table>, all input tokens * are fed to the table renderer, and then the renderer |