Termination of the string is not assured unless the string is one char shorter than the buffer.
Signed-off-by: Mike Holmes <[email protected]> --- platform/linux-generic/odp_packet_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 006d7bd..da9b5a0 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -219,7 +219,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, /* get if index */ memset(ðreq, 0, sizeof(struct ifreq)); - strncpy(ethreq.ifr_name, netdev, IFNAMSIZ); + strncpy(ethreq.ifr_name, netdev, IFNAMSIZ-1); err = ioctl(sockfd, SIOCGIFINDEX, ðreq); if (err != 0) { perror("setup_pkt_sock() - ioctl(SIOCGIFINDEX)"); -- 1.9.1 _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
