X509IF: Fix null pointer dereferencing.

Fixes #18652.
This commit is contained in:
João Valverde 2022-11-17 01:07:28 +00:00
parent c37bb02484
commit 7ce4b153ae
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ x509if_frame_end(void)
const char * x509if_get_last_dn(void)
{
return wmem_strbuf_get_str(last_dn_buf);
return last_dn_buf ? wmem_strbuf_get_str(last_dn_buf) : NULL;
}
gboolean x509if_register_fmt(int hf_index, const gchar *fmt)

View File

@ -2092,7 +2092,7 @@ static int dissect_HierarchyBelow_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
const char * x509if_get_last_dn(void)
{
return wmem_strbuf_get_str(last_dn_buf);
return last_dn_buf ? wmem_strbuf_get_str(last_dn_buf) : NULL;
}
gboolean x509if_register_fmt(int hf_index, const gchar *fmt)