Skip to content

Commit

Permalink
Removing Klocwork issues from schema.h
Browse files Browse the repository at this point in the history
Removing Klocwork static code analysis critical issues:

line 358:
'this->notValidatorIndex_' might not be initialized in this constructor.
line :412
Pointer 'schemaDocument' checked for NULL at line 412 may be passed to function and may be dereferenced there by passing argument this to function 'CreateSchema' at line 419. Also there are 7 similar errors on lines 467 479 511 523 533 538 549.
  • Loading branch information
piotr-kaminski-intel committed Oct 6, 2017
1 parent 2a0bc60 commit b217cc6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions include/rapidjson/schema.h
Expand Up @@ -355,6 +355,7 @@ class Schema {
not_(),
type_((1 << kTotalSchemaType) - 1), // typeless
validatorCount_(),
notValidatorIndex_(),
properties_(),
additionalPropertiesSchema_(),
patternProperties_(),
Expand Down Expand Up @@ -409,11 +410,9 @@ class Schema {
}
}

if (schemaDocument) {
AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document);
AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document);
AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document);
}
AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document);
AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document);
AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document);

if (const ValueType* v = GetMember(value, GetNotString())) {
schemaDocument->CreateSchema(&not_, p.Append(GetNotString(), allocator_), *v, document);
Expand Down

0 comments on commit b217cc6

Please sign in to comment.