The destination string may not have a null termination if
the source string's length is equal to the sizeof.
Fix by replacing strncpy with strlcpy that guarantees NULL-termination.
[merged several commits]
Coverty issue: 272606
Fixes:
d75c371e9b46 ("examples/ip_pipeline: add pipeline object")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Coverty issue: 272594
Fixes:
133c2c6565d6 ("examples/ip_pipeline: add link object")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Coverty issue: 272603
Fixes:
2f74ae28e23f ("examples/ip_pipeline: add tap object")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Coverity issue: 272588
Fixes:
6bfe74f8c93e ("examples/ip_pipeline: add mempool object")
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
Coverity issue: 272592
Fixes:
25961ff3bcb9 ("examples/ip_pipeline: add traffic manager object")
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
Coverity issue: 272562
Fixes:
9a408cc8ac ("examples/ip_pipeline: add KNI object")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
Coverity issue: 272580
Fixes:
719374345c ("examples/ip_pipeline: add action profile objects")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
Coverity issue: 272572
Fixes:
719374345cee ("examples/ip_pipeline: add action profile objects")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Coverity issue: 272563
Fixes:
8245472c58c8 ("examples/ip_pipeline: add sw queue object")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
#include <stdlib.h>
#include <string.h>
+#include <rte_string_fns.h>
+
#include "action.h"
#include "hash_func.h"
}
/* Node fill in */
- strncpy(profile->name, name, sizeof(profile->name));
+ strlcpy(profile->name, name, sizeof(profile->name));
memcpy(&profile->params, params, sizeof(*params));
profile->ap = ap;
}
/* Node fill in */
- strncpy(profile->name, name, sizeof(profile->name));
+ strlcpy(profile->name, name, sizeof(profile->name));
memcpy(&profile->params, params, sizeof(*params));
profile->ap = ap;
#include <rte_ethdev.h>
#include <rte_bus_pci.h>
+#include <rte_string_fns.h>
#include "kni.h"
#include "mempool.h"
return NULL;
/* Node fill in */
- strncpy(kni->name, name, sizeof(kni->name));
+ strlcpy(kni->name, name, sizeof(kni->name));
kni->k = k;
/* Node add to list */
#include <string.h>
#include <rte_ethdev.h>
+#include <rte_string_fns.h>
#include "link.h"
#include "mempool.h"
}
/* Node fill in */
- strncpy(link->name, name, sizeof(link->name));
+ strlcpy(link->name, name, sizeof(link->name));
link->port_id = port_id;
link->n_rxq = params->rx.n_queues;
link->n_txq = params->tx.n_queues;
#include <string.h>
#include <rte_mbuf.h>
+#include <rte_string_fns.h>
#include "mempool.h"
}
/* Node fill in */
- strncpy(mempool->name, name, sizeof(mempool->name));
+ strlcpy(mempool->name, name, sizeof(mempool->name));
mempool->m = m;
mempool->buffer_size = params->buffer_size;
#include <rte_ip.h>
#include <rte_tcp.h>
+#include <rte_string_fns.h>
#include <rte_port_ethdev.h>
#ifdef RTE_LIBRTE_KNI
#include <rte_port_kni.h>
}
/* Node fill in */
- strncpy(pipeline->name, name, sizeof(pipeline->name));
+ strlcpy(pipeline->name, name, sizeof(pipeline->name));
pipeline->p = p;
pipeline->n_ports_in = 0;
pipeline->n_ports_out = 0;
#include <stdlib.h>
#include <string.h>
+#include <rte_string_fns.h>
+
#include "swq.h"
static struct swq_list swq_list;
}
/* Node fill in */
- strncpy(swq->name, name, sizeof(swq->name));
+ strlcpy(swq->name, name, sizeof(swq->name));
swq->r = r;
/* Node add to list */
#include <string.h>
#include <unistd.h>
+#include <rte_string_fns.h>
+
#include "tap.h"
#define TAP_DEV "/dev/net/tun"
return NULL;
}
/* Node fill in */
- strncpy(tap->name, name, sizeof(tap->name));
+ strlcpy(tap->name, name, sizeof(tap->name));
tap->fd = fd;
/* Node add to list */
#include <stdlib.h>
+#include <rte_string_fns.h>
+
#include "tmgr.h"
static struct rte_sched_subport_params
}
/* Node fill in */
- strncpy(tmgr_port->name, name, sizeof(tmgr_port->name));
+ strlcpy(tmgr_port->name, name, sizeof(tmgr_port->name));
tmgr_port->s = s;
tmgr_port->n_subports_per_port = params->n_subports_per_port;
tmgr_port->n_pipes_per_subport = params->n_pipes_per_subport;