From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91F6F22D7B5 for ; Wed, 19 Nov 2025 01:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763515399; cv=none; b=H0B3G1FN0dcodF5uA+X1Guos8FJZ8wzbgXEqf+gMEnMSs7UWd7joqBjaOiPM7yPPz/MyYNbE9CsP/m3y+SLHAtYrGMNpESkb2UKmmzgGGiStl+KKSKyjMKhprOuyG+Yx49Sm0Lku/us5EL5651Uk/PV7MvK8iRyE2UWKEd5HodY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763515399; c=relaxed/simple; bh=0m9Uv4AqO22PB88x2xTdXO7eeEk9xoyNz8aELyUSLaY=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=FdlCrh2SKLlgvqQQlDSpg2j6cwZjDCYstG71SmzXUjEhgz2uZ1cjpm6JOHA9/dgEzs+VZeRATI93ZN+Dfev4074NUEw9+Lt/7uzk4qJ5fnx4+XDPz9TGsBuVF1WxjvXQNQ5U+FMdgqhjlHhxCtHtyrGUDwR4JzjQ+51Epj7qBhU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=aPByPSY5; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="aPByPSY5" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763515385; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BDnn5YvJodsbLkYhj59/j5HwsXdLAb4xVLxw1OpDl7g=; b=aPByPSY5l94yXeICNlZPE6mw5XIerI/cY2ordCbj19LZnGgTeBMall/PrTlCLEk02lN6o9 7kaaoPUozSEWcMBctmdcw/zQ3hVzlw9u/F7G+gybsNs4fxGDi7y4q1GxxWyDFh1eL/szDN R+AmO/U7x+m0XbKe9Z+UwUR2VTwSIuk= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PATCH] ksmbd: Replace strcpy + strcat with scnprintf in convert_to_nt_pathname X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum In-Reply-To: <20251118223513.241aed65@pumpkin> Date: Wed, 19 Nov 2025 02:23:01 +0100 Cc: Namjae Jeon , Steve French , Sergey Senozhatsky , Tom Talpey , linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <620FC0E4-E745-429B-BF16-BCC2D5924E1D@linux.dev> References: <20251118122555.75624-2-thorsten.blum@linux.dev> <20251118223513.241aed65@pumpkin> To: David Laight X-Migadu-Flow: FLOW_OUT On 18. Nov 2025, at 23:35, David Laight wrote: > On Tue, 18 Nov 2025 13:25:56 +0100 > Thorsten Blum wrote: > >> strcpy() is deprecated and using strcat() is discouraged; use the safer >> scnprintf() instead. No functional changes. >> >> Link: https://github.com/KSPP/linux/issues/88 >> Signed-off-by: Thorsten Blum >> --- >> [...] > > Ugg... > If nothing else non-constant formats are definitely frowned upon. > Never mind the non-trivial cpu cost of printf. > > OTOH once you've got the string length, just use memcpy(). > That way you know you won't overflow the malloc buffer even > if someone changes the string on you. Ok, I'll submit a v2. Thanks, Thorsten