-
Notifications
You must be signed in to change notification settings - Fork 282
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
Problems processing incorrect LangAlt values #1481
Comments
I will look at this more tomorrow. Also, the templates used when posting an issue are missing. They were stored in the |
@postscript-dev If I grant you write access to our repos, can you deal with this? Please read this to understand what's going on with master/old-master. #1466 (comment) Here's my situation. I worked 14 hours/day last week and again this week on BMFF support. #1475 (comment) After that I have to ship Exiv2 v0.27.4 RC1 on 2021-03-31. #1018 (comment) I was 70 in January and the plan was to retire. |
Yes, I intended to submit - hopefully today. I posted so that I could reference this in the testing and commit message and didn't intend to burden you with the work.
Thank you for all your hard work, it is appreciated. |
@postscript-dev That's the man, Mr PostScript. Thanks. I'll open the repos now. I know you'll treat it with the respect it deserves. Welcome aboard. When you submit the PR, I'll review and approve. The PR will merge when the CI is green. |
+ Fix segmentation faults in langAlt parse + Fix mismatched quotation marks and incorrect values + Add Python testing + Some tests commented out as quotation marks are filtered, preventing them from running. Closes Exiv2#1481.
Describe the bug
The processing problems fall into four categories.
To Reproduce
The problems have been observed on the
old-master
and the0.27-maintenance
branches (though expected on previous branches also).This causes a segmentation fault when running
This applies to any LangAlt tag and any image.
This is found when running
exiv2 -M "set Xmp.dc.title lang=\"\" test2" any_image.jpeg
This applies to any LangAlt tag and any image.
e.g.
This applies to any LangAlt tag and any image.
e.g.
This applies to any LangAlt tag and any image.
Expected behavior
Exiv2 is expected to cope with a LangAlt statement even if it is not well formed - usually by throwing an exception. The examples in 2) and 3) are accepted and returned by the API, giving the impression that they are valid.
Desktop (please complete the following information):
Additional context
The problem occurs because of issues in the src/value.cpp file, namely the
function.
The segmentation fault is due to not checking the result of
std::string::size_type pos = buf.find_first_of(' ');
By not checking if the language is empty, this value is added into
LangAltValue
'sValueType
and thexmpsdk
does not filter this out. I don't think this is allowed under the Xmp specification but others may know better. Using the above example,Mismatched and/or incorrect positioning of quotation marks
Pairs of double quotes are accepted around the outside of the language value.
Invalid characters in language part
The accepted language value is defined in IEFT RFC3066 and I think that it should only contain A-Z (either case), 0-9 and one '-'.
The text was updated successfully, but these errors were encountered: