-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix limitation for size of data:*:base64 images and max length of the html input line #454
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK wth allowing larger strings, but I don't want them to be unbounded - HTMLDOC is used to provide live conversions on web servers.
@@ -420,18 +420,22 @@ file_find_check(const char *filename) /* I - File or URL */ | |||
|
|||
if ((data = strstr(filename, ";base64,")) != NULL) | |||
{ | |||
len = sizeof(buffer); | |||
len = strlen(filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to have some limits in place to avoid out-of-control memory allocations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree... actually it must be limited in htmllib.cxx line(s) reader
10240 is definitely too small, limit it to something x100 times bigger ? is not big problem for server application ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might work, will run the numbers...
@@ -15,7 +15,7 @@ | |||
#include "htmldoc.h" | |||
#include "http.h" | |||
#include <ctype.h> | |||
|
|||
#include <string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and while I do use C++ in HTMLDOC, I've avoided pulling in the standard C++ library since it seems to change with every major OS release on multiple platforms...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought this file was renamed to .cxx keeping in mind idea write c++ code :)
imho std::string is very very stable, it can be replaced by std::vector or do you suggest to implement custom byte vector ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libstdc++ has changed in incompatible ways 6 times in the last ~20 years, making it very hard to provide binaries of HTMLDOC that depend on it.
this patch removes these limitations
test command is:
cat ./test.html | htmldoc --webpage -t pdf - > test.pdf
test.html is attached
test.html.zip