Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3806841pxj; Mon, 24 May 2021 15:37:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDRAGOtpXpOoBTws8vppKXJ8CGpLnl+j/N5etICFigv7u3zXt/ivN08dyRnejDELNbVuwV X-Received: by 2002:a6b:7948:: with SMTP id j8mr2578187iop.32.1621895847739; Mon, 24 May 2021 15:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621895847; cv=none; d=google.com; s=arc-20160816; b=floXOu4JUUkQhqBwqNE461iorIkhjn0yCf9ZwbuUmDmufjdCgzfZkE05t+vCwOKwel MWWCnEOitm/Q52+/+PkIPft3z7h7f7qnWewqzBnSd1X2gYlGqe48Ap3TI0IH8ukUk/ut ej48Sv8fkscFgKl5UlP54jBaDhWC2UgGZPSVrGvqplZidASqD4pH11xW8GvMbD/onr9K ov5G9l26HtjUNV3CoFmedfROiYSf5YsYyuXZGXlyYH88o0xTGapFyrJWjJPBurksi91i cMkXYAwj0/qUp6e18AMaV+8uNoKXW/+V+9hiORnKpz4Y2ZeryZk7xYO0U1BOiwuWsUIb EI8w== 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=X0yFF82a1Az4UvXe/zXqJjPH4qoCqvbbbTHBPZwhZyE=; b=iVPhAFo8E93qmy7c+NWmZAcUXISRSYKWrKhR6CtRbak+Jd6GLc+gdU7JuWz+2XS2Lq MSi2wfs2zQQRfW+Sh2rYmDDb7xnxwKXj0a35vDYaaNibiFUGPkySIp/jga48sMoQ3tY4 NOvKC8VHmlNmGI2YoeRB3k6QNRO24OXwl95yceEldweoptRyZmObMNqp9r+/PVfzJlEZ 2WsejsJuHV2KFEWg0WLTeHBfWiPETQS5p0e3Fpu+avJFnDp2msFDz7h+bSCijPiQCA+s ncJK/GFc2l8XhFS/+OhRelqqH/cuOpHbxvwDYyef5iQp0+i84I4pCVzHbGfKU7mtLClr wDTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 16si17197096iou.15.2021.05.24.15.37.13; Mon, 24 May 2021 15:37:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbhEXWh4 (ORCPT + 99 others); Mon, 24 May 2021 18:37:56 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:60583 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbhEXWh4 (ORCPT ); Mon, 24 May 2021 18:37:56 -0400 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 15A0FFF803; Mon, 24 May 2021 22:36:24 +0000 (UTC) From: Alexandre Belloni To: Dan Carpenter , Alessandro Zummo , "Kim, Milo" Cc: Alexandre Belloni , kernel-janitors@vger.kernel.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH] rtc: fix snprintf() checking in is_rtc_hctosys() Date: Tue, 25 May 2021 00:36:24 +0200 Message-Id: <162189577175.211185.2359785793574104400.b4-ty@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 May 2021 10:19:26 +0300, Dan Carpenter wrote: > The scnprintf() function silently truncates the printf() and returns > the number bytes that it was able to copy (not counting the NUL > terminator). Thus, the highest value it can return here is > "NAME_SIZE - 1" and the overflow check is dead code. Fix this by > using the snprintf() function which returns the number of bytes that > would have been copied if there was enough space and changing the > condition from "> NAME_SIZE" to ">= NAME_SIZE". Applied, thanks! [1/1] rtc: fix snprintf() checking in is_rtc_hctosys() commit: 54b909436ede47e0ee07f1765da27ec2efa41e84 Best regards, -- Alexandre Belloni