Summary: | Parley crashed on export to html | ||
---|---|---|---|
Product: | [Applications] parley | Reporter: | GreyShaman <greyshaman> |
Component: | general | Assignee: | parley bug tracker <parley-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | |
Priority: | NOR | ||
Version: | 0.9.3 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/parley/f44b055cf894742aab8c138121d6da810bb6cd8d | Version Fixed In: | 4.11.3 |
Sentry Crash Report: |
Description
GreyShaman
2010-05-18 11:30:07 UTC
I have the same problem with parley version 0.9.4 (KDE 4.5.5), when I try to export to a file like "/home/xxx/日本語/test.html". The interesting part is, that "/home/xxx/日本語/test.html" doesn't work, but "/home/xxx/日本語.html" works, I just get an "???.html" file. Thus, I guess the problem is the "invalid" folder (since there seems to be a conversion to "/home/xxx/???/", which doesn't exist). You can see the problem in the file "src/export/exportdialog.cpp" in lines 89-91: -- snip -- FILE* result = fopen( (const char*) filename.toLocalFile().toLatin1(), "w"); xsltSaveResultToFile(result, res, cur); fclose(result); -- snap -- (Note: the relevant part still exists in the KDE 4.6 release and trunk; the websvn version is the latest version, isn't it?) As you can see, the main problem is that there are no error checks at all. I guess it would be best to add a test whether fopen() succeeded (check FILE* result for NULL, fclose(NULL) segfaults!), and to check the return value of xsltSaveResultToFile() (it returns the number of written bytes, -1 in case of an error). In the latter case one could open a warning message. Does anybody know, if this is a general KUrl related problem? Git commit f44b055cf894742aab8c138121d6da810bb6cd8d by José Manuel Santamaría Lema. Committed on 29/10/2013 at 10:15. Pushed by joselema into branch 'KDE/4.11'. Check if the file is writable when exporting to HTML. Without this change the program would crash if you couldn't write to the specified file (for instance when you don't have write permissions in the path in question). REVIEW: 113490 M +7 -2 src/export/exportdialog.cpp http://commits.kde.org/parley/f44b055cf894742aab8c138121d6da810bb6cd8d |