A PCTYPE entry with no matching protocols leaves its name empty.
Removing the trailing separator then writes outside the name buffer.
Skip entries with an empty name before removing the separator. An
entry without a name cannot match any customized PCTYPE.
Fixes: e163c18a15b0 ("net/i40e: update ptype and pctype info")
Cc: [email protected]
Signed-off-by: Artem Novikov <[email protected]>
---
drivers/net/intel/i40e/i40e_ethdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/intel/i40e/i40e_ethdev.c
b/drivers/net/intel/i40e/i40e_ethdev.c
index 498c5c7ec4..ef2fc8c876 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -10815,6 +10815,8 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev,
uint8_t *pkg,
break;
}
}
+ if (!name[0])
+ continue;
name[strlen(name) - 1] = '\0';
PMD_DRV_LOG(INFO, "name = %s", name);
if (!strcmp(name, "GTPC"))
--
2.56.0