-
Notifications
You must be signed in to change notification settings - Fork 429
Fuzz testing tidy-html5 #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
sample crash:
|
Thanks for taking this on, @mthorpe7!
It would be best to tie commits to specific, fixed test cases. If you have one large test case, then a single commit might be okay, but it depends on how "invasive" the fixes become. A single PR is okay, and commits that each resolve a specific issue are appreciated. If you prefer separate PR's, then that's fine, too. @geoffmcl generally likes smaller PR's, and although he's on holiday now, he's generally much more consistent in attending PR's than I am (I often disappear for months at a time due to other commitments). |
@mthorpe7 thanks for reporting, and as @balthisar says, PR's are very welcome... Certainly, just trying your simple sample with the <html xmlns:o="urn:schemas-minrosoft-com:office:office"X<?ody><table><img class="" /></table></body></html> That particular problem can be avoided with the small patch - diff --git a/src/clean.c b/src/clean.c
index 707e4d9..fc5ca31 100644
--- a/src/clean.c
+++ b/src/clean.c
@@ -1902,7 +1902,8 @@ void TY_(CleanWord2000)( TidyDocImpl* doc, Node *node)
attval = node->attributes;
while ( attval ) {
next_attr = attval->next;
- if ( strcmp(attval->attribute, "xmlns") != 0 )
+ /* Issue #591 - take care of a NULL attribute */
+ if ( !attval->attribute || ( strcmp(attval->attribute, "xmlns") != 0 ))
TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE);
attval = next_attr;
} And also please checkout the patch proposed in #588. This was certainly one case where invalid utf-8 could cause a problem, hopefully fixed by that patch... As @balthisar mentioned, I am still on vacation until mid Sept, so do not have time now, but look forward to your efforts to make tidy crash/hang free... thanks... |
Has anyone had a chance to test my suggested patch for at least the one And @mthorpe7 you suggest a a plethora of crashes/hangs... can you enumerate, give specific examples... thanks |
Merged. @mthorpe7, since no support is required for your original request, I will close this. Certainly you are free to submit any type of PR's, and those will open new message threads as they happen. Thanks! |
I've been fuzz testing tidy with AFL recently, and come across a plethora of crashes/hangs (mostly revolving around invalid UTF8). I intend to fix these crashes, but I suspect each fix will be a different code change.
How would you like these fixes to be upstreamed? A single PR with a single commit, a single PR with many commits or many PRs with single commits?
The text was updated successfully, but these errors were encountered: