bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref

The relationship of info->def_length to strlen(info->def_string) should
only be tested if info->def_string is not NULL.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I125a8d5da8b8f23401604c2ab32c2ed17956b74c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cf66e0f..e990245 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -50,3 +50,4 @@
 2. transport: Prevent sticking in waiting for response
 3. transport: Match on response in pldm_transport_send_recv_msg()
 4. requester: Add check before accessing hdr in pldm_recv()
+5. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref
diff --git a/src/bios_table.c b/src/bios_table.c
index a191a42..436f3e6 100644
--- a/src/bios_table.c
+++ b/src/bios_table.c
@@ -391,7 +391,7 @@
 		set_errmsg(errmsg, "Wrong StringType");
 		return PLDM_ERROR_INVALID_DATA;
 	}
-	if (info->def_length != strlen(info->def_string)) {
+	if (info->def_string && info->def_length != strlen(info->def_string)) {
 		set_errmsg(errmsg, "Length of DefaultString should be equal to "
 				   "DefaultStringLength");
 		return PLDM_ERROR_INVALID_DATA;