Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D091ECAAA1 for ; Fri, 28 Oct 2022 09:11:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A948984EF6; Fri, 28 Oct 2022 11:11:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="eQcO+Rbk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD7FA84EF6; Fri, 28 Oct 2022 11:11:36 +0200 (CEST) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3702984EC3 for ; Fri, 28 Oct 2022 11:11:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32c.google.com with SMTP id n14so2696996wmq.3 for ; Fri, 28 Oct 2022 02:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:reply-to :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=c8RygNvdLbGaRs5N2+ccRqXo+PSVJ6LcIlNJlMOHboc=; b=eQcO+RbkrthKSbGtbT+ibZgkfhsBoVUTPAUYjpiiAAyh3iC6RwoYSPCkz5Md99FvdO TNJabedYn85w1pA72AzV3FUlfu368W04Hlh+DcjuNRGO5mvt5HNkQ743aTYAzQpdnhLp 119dEHjEYn1+JiI37Gw78jcEKrzMNqGdhIHjvGZfT3de8avGRG3NApF8sB4/GY40tRx9 MfQbCXrtdI92cU0h4OwBOt4w5jxYpM6MHhp8avRUB3YM/U+fe/IJZKz5U3LwSZifqb99 5mdmJVApZLY60HzjPD/WDzpd/1d/XHRvlFb0Vmdmly+PeSPWoww3AWiloFzLwKRCPzyQ VDug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:reply-to :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=c8RygNvdLbGaRs5N2+ccRqXo+PSVJ6LcIlNJlMOHboc=; b=wVOdXtZ8OisuJXR1JVNMWW4mOkKHMLANoEGImWi9I5cSOdgXFkGpEo+E/uq/F63LkP Mns2AAfjaUkznmWPkB51BUcwxZN8RijlzKADtYURdzwbKVDFeSxJnXJBPYaXSuauA+uC SRC2Z1PvNPnTDH6CiUVHHfVCL4KfkuhE+UKF00mMEX0pCbOPgCJLzDZ1b9fEAiQQqaKj Cc1y3RdfsGAX2Dl5H5U7B/YvkCWtPerziJwtYKhBVvOH9D2Pb5gjsZOcQ46qd2shhWGx 5wWxZurGq30aNw9c/tHWvmpXZME8YmtfhdeGyhYjhlRET5ZiL05Voy/ukArCz1Q+b7Gd TkTA== X-Gm-Message-State: ACrzQf03OUwG0GqCOCaljZCA6dR1L7uS9J0i3eXU/Tapw6V3aWBdqyZG RfkhZoYAKXmO+lOAowkXZME32w== X-Google-Smtp-Source: AMsMyM6xUMxZvlX0L/yLhPdtI99xehacySq+dFMD2KBUSZC1/0Ea1/8x9H1qodIN4Oc3J771zu3cIw== X-Received: by 2002:a05:6000:154e:b0:236:8ead:3eb4 with SMTP id 14-20020a056000154e00b002368ead3eb4mr7441517wry.71.1666948293789; Fri, 28 Oct 2022 02:11:33 -0700 (PDT) Received: from ?IPV6:2a01:e0a:898:f380:9e9c:c6c2:95a3:c182? ([2a01:e0a:898:f380:9e9c:c6c2:95a3:c182]) by smtp.gmail.com with ESMTPSA id y16-20020adfd090000000b0022ae401e9e0sm3061567wrh.78.2022.10.28.02.11.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 02:11:33 -0700 (PDT) Message-ID: Date: Fri, 28 Oct 2022 11:11:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 3/3] cmd: pxe: use strdup to copy config Content-Language: en-US To: Patrick Delaunay , u-boot@lists.denx.de Cc: Ramon Fried , Peter Hoyes , Artem Lapkin , Heinrich Schuchardt , Simon Glass , Zhaofeng Li , U-Boot STM32 References: <20221028090120.1536827-1-patrick.delaunay@foss.st.com> <20221028110055.3.I4bb4d81ec61fcc6340db1f81d5504905a22e90af@changeid> From: Neil Armstrong Organization: Linaro Developer Services In-Reply-To: <20221028110055.3.I4bb4d81ec61fcc6340db1f81d5504905a22e90af@changeid> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: neil.armstrong@linaro.org Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 28/10/2022 11:01, Patrick Delaunay wrote: > Replace malloc and strcpy by strdup in > function parse_label_kernel. > > Signed-off-by: Patrick Delaunay > --- > > boot/pxe_utils.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c > index 756b201eda91..84e63c5cb85f 100644 > --- a/boot/pxe_utils.c > +++ b/boot/pxe_utils.c > @@ -1180,11 +1180,10 @@ static int parse_label_kernel(char **c, struct pxe_label *label) > if (!s) > return 1; > > - label->config = malloc(strlen(s) + 1); > + label->config = strdup(s); > if (!label->config) > return -ENOMEM; > > - strcpy(label->config, s); > *s = 0; > > return 1; Reviewed-by: Neil Armstrong