On Fri, Jun 03, 2022 at 09:45:45AM +0200, David Marchand wrote: > Hello Vladimir, > > On Thu, Jun 2, 2022 at 8:42 PM Medvedkin, Vladimir > <vladimir.medved...@intel.com> wrote: > > > if (!dst) { > > > rte_pktmbuf_free(m); > > > return NULL; > > > } > > > - if (string != NULL) > > > - rte_memcpy(dst, string, t_len); > > > - else > > > - memset(dst, 0, t_len); > > > + if (string != NULL) { > > > + size_t off; > > > + > > > + for (off = 0; off + string_len < len; off += > > > string_len) > > > > I think it should be off + string_len <= len here, because otherwise, if > > len is a multiple of string_len, the last ret_memcpy (after this loop) > > will copy 0 bytes. > > Changing to off + string_len <= len would trigger an oob access to dst > (by one extra byte)? > Otoh, I don't think it is an issue to have a 0-length call to rte_memcpy. > Given this is test code, do we need rte_memcpy for performance over regular libc memcpy? Does fixing the warning become any easier or clearer if libc memcpy is used?
- Re: [PATCH v2] vhost/crypto: fix build with G... David Marchand
- [PATCH 11/12] app/flow-perf: fix build with GCC 12 David Marchand
- Re: [PATCH 11/12] app/flow-perf: fix build with G... Bruce Richardson
- RE: [PATCH 11/12] app/flow-perf: fix build with G... Wisam Monther
- Re: [PATCH 11/12] app/flow-perf: fix build wi... David Marchand
- RE: [PATCH 11/12] app/flow-perf: fix buil... Wisam Monther
- Re: [PATCH 11/12] app/flow-perf: fix build with G... Stephen Hemminger
- [PATCH 12/12] test/ipsec: fix build with GCC 12 David Marchand
- Re: [PATCH 12/12] test/ipsec: fix build with GCC ... Medvedkin, Vladimir
- Re: [PATCH 12/12] test/ipsec: fix build with ... David Marchand
- Re: [PATCH 12/12] test/ipsec: fix build w... Bruce Richardson
- Re: [PATCH 12/12] test/ipsec: fix bui... David Marchand
- Re: [PATCH 12/12] test/ipsec: fi... Medvedkin, Vladimir
- Re: [PATCH 12/12] test/ipsec: fix build with GCC ... Stephen Hemminger
- [PATCH v2] test/ipsec: fix build with GCC 12 David Marchand
- Re: [PATCH v2] test/ipsec: fix build with GCC... David Marchand
- [PATCH v3] vhost/crypto: fix build with GCC 12 David Marchand
- Re: [PATCH v3] vhost/crypto: fix build with G... Maxime Coquelin
- Re: [PATCH 00/12] Fix compilation with gcc 12 Stephen Hemminger
- RE: [PATCH 00/12] Fix compilation with gcc 12 Morten Brørup
- Re: [PATCH 00/12] Fix compilation with gcc 12 David Marchand