Commit d95e944d authored by Kishen Maloor's avatar Kishen Maloor

Fix NULL deref in oc_tls_audit_log()

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent b9fd32a3
Pipeline #1074 passed with stage
in 3 minutes and 43 seconds
...@@ -564,10 +564,14 @@ oc_tls_audit_log(const char *aeid, const char *message, uint8_t category, ...@@ -564,10 +564,14 @@ oc_tls_audit_log(const char *aeid, const char *message, uint8_t category,
uint8_t priority, oc_tls_peer_t *peer) uint8_t priority, oc_tls_peer_t *peer)
{ {
char buff[IPADDR_BUFF_SIZE]; char buff[IPADDR_BUFF_SIZE];
SNPRINTFipaddr(buff, IPADDR_BUFF_SIZE, peer->endpoint); if (peer) {
SNPRINTFipaddr(buff, IPADDR_BUFF_SIZE, peer->endpoint);
} else {
buff[0] = '\0';
}
char *aux[] = { buff }; char *aux[] = { buff };
oc_audit_log(peer->endpoint.device, aeid, message, category, priority, oc_audit_log((peer) ? peer->endpoint.device : 0, aeid, message, category,
(const char **)aux, 1); priority, (const char **)aux, 1);
} }
static int static int
......
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