common/mlx5: fix default devargs initialization
[dpdk.git] / drivers / net / i40e / i40e_flow.c
index 9acaa18..e0cf996 100644 (file)
@@ -3043,12 +3043,15 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
                                rte_flow_error_set(error, EINVAL,
                                           RTE_FLOW_ERROR_TYPE_ITEM,
                                           item,
-                                          "Exceeds maxmial payload limit.");
+                                          "Exceeds maximal payload limit.");
                                return -rte_errno;
                        }
 
                        for (i = 0; i < raw_spec->length; i++) {
                                j = i + next_dst_off;
+                               if (j >= RTE_ETH_FDIR_MAX_FLEXLEN ||
+                                               j >= I40E_FDIR_MAX_FLEX_LEN)
+                                       break;
                                filter->input.flow_ext.flexbytes[j] =
                                        raw_spec->pattern[i];
                                filter->input.flow_ext.flex_mask[j] =