Skip to content

Conversation

nijel
Copy link
Contributor

@nijel nijel commented Jun 29, 2016

This can happen after attempt to load nonexisting file.

This used to work fine with old libtidy, but no longer works with html-tidy, so I think it is a regression. I'm not sure the fix is really correct, but it seems to do what is expected for me.

This can happen after attempt to load nonexisting file.
@geoffmcl
Copy link
Contributor

@nijel ok, what I understand is that your app calls tidyDocCleanAndRepair(doc) even when no document loaded! And this causes a crash in the current library, what version?, while it was harmless in an older library version, what version?

Well, that would certainly be a regression bug. Thanks...

But looking at your patch, I do not think this is quite right, even though as you say it works for you...

We need to look at why we need an extra guard for CheckHTML5 and CheckHTMLTagsAttribsVersions... These calls should be harmless, like earlier List2BQ, and several others... with or without a loaded doc...

I think it might be the test if (doc->lexer->versionEmitted & VERS_HTML5) maybe the crash. Maybe there is no lexer if no document loaded...

It will take me a little time to setup a test for this... be back soonest... but look forward to any further information you can supply... thanks...

@geoffmcl geoffmcl added this to the 5.3 milestone Jun 30, 2016
@nijel
Copy link
Contributor Author

nijel commented Jul 1, 2016

It's uTidyLib which is doing this call even when file loading fails. It worked just fine with original Tidy and now leads to segfault.

To reproduce just invoke tidyParseFile on nonexisting file and then tidyCleanAndRepair.

@geoffmcl
Copy link
Contributor

geoffmcl commented Jul 1, 2016

@nijel discussion and patch move to #429 ...

Meantime closing this as not being the correct patch... but thanks for pointing us to it...

@geoffmcl geoffmcl closed this Jul 1, 2016
geoffmcl added a commit that referenced this pull request Jul 11, 2016
This bump also includes merge of #424 - licence fix, and #423 - add
__GLIBC__ to long HAS_FUTIME list.

And coincidentally #427 - an improved french translation!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants