From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 999F4A0555 for ; Fri, 3 Jun 2022 09:46:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81D434282A; Fri, 3 Jun 2022 09:46:04 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id AFF284282A for ; Fri, 3 Jun 2022 09:46:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654242363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eB3WHDyfW22F2F2j+y4sjEHX45+2qJAirkmkaH2uCO0=; b=eOE3D7y5/rahpj9ZuHzThbCd0p3zjSRcGjH3Do62jZGouJz2V41PV8+y/5E8BZO7vq9NkL qYdbOLtz/75OLiLS/tpl8U8lgcrPcNZXM/ToyjM/VNxYZmyLLA5hh33ZAMRLOGeSfjKFVh R6iFBuJEnmZuCpLXpdmYn/1Dx5ZnEj4= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-286-ztAadjssNWq5S-GKXvY8FA-1; Fri, 03 Jun 2022 03:45:57 -0400 X-MC-Unique: ztAadjssNWq5S-GKXvY8FA-1 Received: by mail-lj1-f198.google.com with SMTP id f10-20020a2e9e8a000000b00250925fec6aso1128220ljk.20 for ; Fri, 03 Jun 2022 00:45:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eB3WHDyfW22F2F2j+y4sjEHX45+2qJAirkmkaH2uCO0=; b=yGsvNzZJDvkBqIAJ1tpt4nDwxLN6wPdHdX2i1ikqL9BdHSjPbrhrVSOvhkd2PwOD52 4+zdSTcRnn1Gy8siAZfCTVDsvu76k+40u4kDhmRRNt1RphcysdHeite+HLtBuGhJ+v6L jndT3TMw9T1c66btPHqGauU1ryUPcXtLAlO6A3inMqh9nwo/TWAG7ze6+MD2TmdwA3vp JGT4CVC6S2usIfTqm+CLM5vOx3KZlqkZcyH8hWEChN8J+AcX70Y7ASiyeYXaBOGWX6Zl TX9p17TdQqr0T7T3saiimBHzquOo1mgblk90kYL4A7svT7QZKlMWRQJEDHlFGRDyQKwx xw7w== X-Gm-Message-State: AOAM532P+EJD36/dXuAKjx+Qv7mPncCUwAkf0mGqk/y5MF2KId0ZJp4o FpXHYgS0ptC1YvQlunEVUfl+NzQtHehvKUHX5CSPggariwNZUFbOf5Ji+aVfmvyO5/9484vfzWB Isim754oh+XvH8OOEMMknwJU= X-Received: by 2002:a19:a418:0:b0:478:fda4:e755 with SMTP id q24-20020a19a418000000b00478fda4e755mr5996666lfc.560.1654242356427; Fri, 03 Jun 2022 00:45:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHv0nvIu7679f0Uel17yMd6eIDW58zQFMO+9kBWvB68FO1HtOPLEtamQWtQajbAXWkUizluQrLzkhbJqtzrUU= X-Received: by 2002:a19:a418:0:b0:478:fda4:e755 with SMTP id q24-20020a19a418000000b00478fda4e755mr5996653lfc.560.1654242356199; Fri, 03 Jun 2022 00:45:56 -0700 (PDT) MIME-Version: 1.0 References: <20220518101657.1230416-1-david.marchand@redhat.com> <20220518101657.1230416-13-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Fri, 3 Jun 2022 09:45:45 +0200 Message-ID: Subject: Re: [PATCH 12/12] test/ipsec: fix build with GCC 12 To: "Medvedkin, Vladimir" Cc: dev , Thomas Monjalon , Ferruh Yigit , dpdk stable , Konstantin Ananyev , Bernard Iremonger Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hello Vladimir, On Thu, Jun 2, 2022 at 8:42 PM Medvedkin, Vladimir 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. > > > + rte_memcpy(&dst[off], string, string_len); > > + rte_memcpy(&dst[off], string, len % string_len); -- David Marchand