Fix Clang static analyzer warnings

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2020-02-24 13:13:23 +01:00 committed by eboasson
parent 0d5a8bf461
commit 1c77aad39c
22 changed files with 154 additions and 37 deletions

View file

@ -15,6 +15,7 @@
#include "dds/ddsrt/misc.h"
#include "mock_authentication.h"
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdbool.h>
@ -72,6 +73,11 @@ DDS_Security_ValidationResult_t validate_local_identity(
}
}
/* for Clang's static analyzer */
assert(identity_certificate != NULL);
assert(identity_ca != NULL);
assert(private_key != NULL);
if( strcmp(identity_certificate, test_identity_certificate) != 0){
result = DDS_SECURITY_VALIDATION_FAILED;

View file

@ -13,6 +13,7 @@
#include "dds/ddsrt/misc.h"
#include "mock_authentication.h"
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdbool.h>
@ -73,6 +74,11 @@ DDS_Security_ValidationResult_t validate_local_identity(
}
}
/* for Clang's static analyzer */
assert(identity_certificate != NULL);
assert(identity_ca != NULL);
assert(private_key != NULL);
if( strcmp(identity_certificate, test_identity_certificate) != 0){
result = DDS_SECURITY_VALIDATION_FAILED;