work-around clang analyzer issues

This allows using the analyzer to detect potential new
issues in code base.
Signed-off-by: Nikos Mavrogiannopoulos's avatarNikos Mavrogiannopoulos <nmav@gnutls.org>
parent 47a3b1c2
Pipeline #18432679 passed with stage
in 53 minutes and 7 seconds
......@@ -1292,7 +1292,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
goto error;
}
max_len -= len2;
if (max_len >= 0)
if (max_len >= 0 && der)
memcpy (der + counter, p->value + len3, len2);
counter += len2;
move = RIGHT;
......
......@@ -393,9 +393,11 @@ asn1_delete_element (asn1_node structure, const char *element_name)
return asn1_delete_structure (&source_node);
}
#ifndef __clang_analyzer__
asn1_node
_asn1_copy_structure3 (asn1_node source_node)
{
/* FIXME: there may be a leak here */
asn1_node dest_node, p_s, p_d, p_d_prev;
int move;
......@@ -448,9 +450,17 @@ _asn1_copy_structure3 (asn1_node source_node)
}
}
while (p_s != source_node);
return dest_node;
}
#else
/* Non-production code */
asn1_node
_asn1_copy_structure3 (asn1_node source_node)
{
return NULL;
}
#endif /* __clang_analyzer__ */
static asn1_node
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment