Skip to content

Commit

Permalink
Check that type isn't an empty string.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse committed Jul 18, 2021
1 parent 92ddbf0 commit d5ada32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@ namespace Exiv2 {
if (buf.length() > 5 && buf.substr(0, 5) == "type=") {
std::string::size_type pos = buf.find_first_of(' ');
type = buf.substr(5, pos-5);
if (type.empty()) {
throw Error(kerInvalidXmpText, type);
}
// Strip quotes (so you can also specify the type without quotes)
if (type[0] == '"') type = type.substr(1);
if (type[type.length()-1] == '"') type = type.substr(0, type.length()-1);
Expand Down

0 comments on commit d5ada32

Please sign in to comment.