Skip to content

Commit

Permalink
Fix uninitialised values for <i> and <dd>
Browse files Browse the repository at this point in the history
Bug-Debian: #16
  • Loading branch information
tats committed Aug 19, 2016
1 parent 1b1803e commit 0fba2f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -4686,6 +4686,12 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
case HTML_DD:
CLOSE_A;
CLOSE_DT;
if (h_env->envc == 0 ||
(h_env->envc_real < h_env->nenv &&
envs[h_env->envc].env != HTML_DL &&
envs[h_env->envc].env != HTML_DL_COMPACT)) {
PUSH_ENV(HTML_DL);
}
if (envs[h_env->envc].env == HTML_DL_COMPACT) {
if (obuf->pos > envs[h_env->envc].indent)
flushline(h_env, obuf, envs[h_env->envc].indent, 0,
Expand Down
1 change: 1 addition & 0 deletions parsetagx.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ parse_tag(char **s, int internal)
*(p++) = *(q++);
SKIP_BLANKS(q);
}
tagname[0] = '\0';
while (*q && !IS_SPACE(*q) && !(tagname[0] != '/' && *q == '/') &&
*q != '>' && p - tagname < MAX_TAG_LEN - 1) {
*(p++) = TOLOWER(*q);
Expand Down

3 comments on commit 0fba2f1

@kcwu
Copy link
Contributor

@kcwu kcwu commented on 0fba2f1 Aug 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch introduce other problem.

$ echo '<table>' > foo
$ ./w3m -T text/html -dump foo

w3m hangs forever

@kcwu
Copy link
Contributor

@kcwu kcwu commented on 0fba2f1 Aug 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p.s. echo '<table>' | ./w3m -T text/html -dump just crash, not hang.

@tats
Copy link
Owner Author

@tats tats commented on 0fba2f1 Aug 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, reverted for now.

Please sign in to comment.