Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6549083rwi; Mon, 24 Oct 2022 02:59:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kx8oD/91xddROWA1UpjLN3Xy/88Ym06JdHbvR8awJPEzN+MKB9HXZrSu0BqrHFtix1+mR X-Received: by 2002:a17:90b:1a88:b0:20d:8df0:ac64 with SMTP id ng8-20020a17090b1a8800b0020d8df0ac64mr36919439pjb.140.1666605584028; Mon, 24 Oct 2022 02:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666605584; cv=none; d=google.com; s=arc-20160816; b=iRiBLPqx2uTp4+EJXFtZMA3w9emjoWjFfzvzwnN0HDpZClGL1VorXxOWBi1OjXHz1u ZRQGNdqiZwtUKYFaA+aMzRxjoJWtOsDiv+ZykeRjyzkdmmuo2Ne3LSWKlQaKxvGAZWMM snwKi8e3A9DoAYG5/B1aXSX1z3DaNtpvBj5NnmBl4R2/MHUTpMXiFvRlVUgzrpL1kPJQ Jo/NJ4xYI58hxsZIRMOZorpixvhAe7kvMPULxXfs3tDp0HRMfQ5JMBh/yhjxsH1TZPN/ PSDSZo9L2AcjRaeKyz+wMlaS9UEmFvLwoGHvoHkJ94ie/VSjLNR2W5yEhsyPvrseCXn9 LBKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=HshJJnBtgjNBzrWrQC79kfG3K3eSYkdowfUwFWS4EcA=; b=p2UkHty1uXG3UP/qwPph8UeLF1Y5nU8/AIgQtkzS2uyuuuyMaUhu5uiLdtE0jcLGCb sfsvAyHm1wjYN9pEpBGtXJ1pQ+pdhXMJeC7D4uJHSkObNQOIITlRY8w+quA7OwXV42rT HcsoQPJOQWNq5FFdAHuYsR2bx5nk51t/kT0qR/VLJrmPRpKePrV4+dajxSsCimyXeVDy 5liG7qSl7Jv4Dl9ZTDI/jGI7YVt+0lXZqLNJ8k8o2Wezqrdjt4JZDkxfo2sCOkjHqFux eXs1H0YIxVRYtbxJUw8PU9JBDQ/JaeaDLY+Z6t+dbYoy+mSaNihKRnrPjmYHQ+j/fXle P0Bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090a7e0800b00205f49b70fdsi13857623pjl.127.2022.10.24.02.59.31; Mon, 24 Oct 2022 02:59:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbiJXJjs (ORCPT + 99 others); Mon, 24 Oct 2022 05:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiJXJjp (ORCPT ); Mon, 24 Oct 2022 05:39:45 -0400 Received: from mail.nfschina.com (unknown [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E15A41AF26; Mon, 24 Oct 2022 02:39:40 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 2F9FC1E80D74; Mon, 24 Oct 2022 17:38:23 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tdZp91qkmLYB; Mon, 24 Oct 2022 17:38:20 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 794481E80CA5; Mon, 24 Oct 2022 17:38:20 +0800 (CST) From: Li zeming To: bagasdotme@gmail.com Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, masahiroy@kernel.org, zeming@nfschina.com Subject: Re: [PATCH] lxdialog: menubox: Add malloc allocation judgment Date: Mon, 24 Oct 2022 17:39:22 +0800 Message-Id: <20221024093923.179944-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If malloc allocation fails, the menu_item pointer cannot be executed, because when the strncpy function is executed, there will be a problem with the null pointer. Adding an if statement should ensure that the allocation fails and will not be executed. thanks.