Skip to content

Commit

Permalink
Merge pull request #67 from arangodb/bug-fix/key-translation-error-es616
Browse files Browse the repository at this point in the history
could break Slice::translate with negative int / garbled key
  • Loading branch information
jsteemann committed Jun 8, 2020
2 parents d11b92e + bbaea58 commit 5043e35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void Validator::validateCompactObject(uint8_t const* ptr, std::size_t length) {
validate(p, e - p, true);
Slice key(p);
bool isString = key.isString();
if (!isString && !key.isInteger()) {
if (!isString && !key.isSmallInt() && !key.isUInt()) {
throw Exception(Exception::ValidatorInvalidLength, "Invalid object key type");
}
ValueLength keySize = key.byteSize();
Expand Down Expand Up @@ -562,7 +562,7 @@ void Validator::validateIndexedObject(uint8_t const* ptr, std::size_t length) {

Slice key(member);
bool const isString = key.isString();
if (!isString && !key.isInteger()) {
if (!isString && !key.isSmallInt() && !key.isUInt()) {
throw Exception(Exception::ValidatorInvalidLength, "Invalid object key type");
}

Expand Down

0 comments on commit 5043e35

Please sign in to comment.