using assert() to check null is good for development
but if it is used partly (using both of assert() and if condition)
SVACE system detects it as defect because to checking it by if condition
means there is probability that it could be null.
So we should choose only one of them(To use assert() or if condition) on
entire of code.
Change-Id: I0da13027c650e11f88f5b06fa35d8f86d43ee879
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
}
key = key_get_simple(c->backup_ctx->sym_key);
- assert(key != NULL);
+ if (key == NULL)
+ return YACA_ERROR_INVALID_PARAMETER;
ret = encrypt_ctx_init(c, c->backup_ctx->cipher, key->bit_len);
assert(ret != YACA_ERROR_INVALID_PARAMETER);
assert(lpadding != -1);
lasym_key = key_get_evp(key);
- assert(lasym_key != NULL);
+ if (lasym_key == NULL)
+ return YACA_ERROR_INVALID_PARAMETER;
ret = EVP_PKEY_size(lasym_key->evp);
if (ret <= 0) {