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 F35EDA0555; Fri, 3 Jun 2022 09:46:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91ED84281B; Fri, 3 Jun 2022 09:46:02 +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 10BB44021E for ; Fri, 3 Jun 2022 09:46:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654242361; 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=dGKFmJ7W1zAnUFDs1v+s0JvfUJB+21Uy9+kIVkze2LUeniLYJxguNNDcSp7EP8GZyQQUwh qkSol87dADOA9lrKeNgWqHX9GxkJKsjJrUt0YQ4gD890vQUvoFE3apwnNbSnLjfCVjXgCD Q95sUuL9JLo9KYhe0hQ7zrbiW/XXXzM= 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-606-ZNnb-_67M7qiWGZ07YWBtA-1; Fri, 03 Jun 2022 03:45:58 -0400 X-MC-Unique: ZNnb-_67M7qiWGZ07YWBtA-1 Received: by mail-lj1-f198.google.com with SMTP id y20-20020a05651c021400b00253f0227639so1139458ljn.0 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=QLxT4yhJu8WGIhkCFVTdtIqr0VTftSx74YeL8sIY3p8CyH+G44ALY+N4wMqfDvjXF8 V50yt7Y3m2q1N5Z6mzXzRORBDbrR+xCPnMP77Lp4aLWj7VOqXbYm7MdbQnT5JcB4yVLn VG5dRgZk9GjHaMbZ8GfuU90/tzUQWt5+xA9d7e/sGSbwugBuWvC8USWoRXlM6b09pkGJ tQEO3Xhs421OkAUSpV/DNjgGhVh/6ilfmNi6gNYvJJ7IqDIfPicsrGRxS+5kZOOvKG3a cIRUVy2OjHW6oeHHKvbbuarn7qYiyVb/w/OajqsR+1W2r41ooGuK+OlDE19K361AvvOF yzJA== X-Gm-Message-State: AOAM530czLDEIk/CCoB21LGuxTxg/wecovgNYYuRxEXncxnaVOGmE9Ln VmE16yTsEQDyy6ddCUGUtwrotA+08A4qAOnCoXcARTF6YBFTngub+tVe51K3hHgfiwIkBUJUiir 4HYjDvKvpUlgbSFXynzs= X-Received: by 2002:a19:a418:0:b0:478:fda4:e755 with SMTP id q24-20020a19a418000000b00478fda4e755mr5996672lfc.560.1654242356504; 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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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