Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4FC72D5A16 for ; Thu, 10 Jul 2025 10:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752142188; cv=none; b=OeWDU/4wjjwmDgOqp06Txq76mmQIFXUod1AZ9jXesyDbq5CXJuUTy6NLsmGxsbQjsLnyWEiF3Qdwml/uglGWwvsgF1KYqzEAzLVee12hVQIQGk8IIQB/XUR8UgOp4HP9cnty7Re0YBqtK+e38ZQ7+EA+UhmLdImAbXZEAORAKoc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752142188; c=relaxed/simple; bh=WGEF/wsB1Z4K1KkbdrhVe/Me3rv5UHQOXnk1OmCy4uM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pdiLKNDeHMDnFzMKEt7uhiWCQJUu93uP4Q7G2DPwbDhawsujBNBLkHiOkz/w4pYwYaMBYEuP/UEkI4pj2o2mjtn0bFBxN2zUXDOTPd+GE3l038zy29ksbz15EtSQgRiGjIpBn/hIQhz53iPnBgkFYJ++Y4WsrP0ZT6FTXv97mgs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=q/RAE2rP; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=BDmPGUJg; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=q/RAE2rP; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=BDmPGUJg; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="q/RAE2rP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="BDmPGUJg"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="q/RAE2rP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="BDmPGUJg" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7FF271F385; Thu, 10 Jul 2025 10:07:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1752142064; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X8wOSqp2tcorETbRhwjUnbU/crZZr8rxegSX7UhjIqc=; b=q/RAE2rPVrQ/+1sm3fYeuvRCWcxRuHYYi4MACWui7KQlYCEbxjaTVLuk/iLY8t0vBZVm7n uj8BjvgJi5+xn6yVrCro+bWOn8sTm0uEpxYC1STESNcKOgUSIZ/7j51c0MZe7mYXe+jRtx 0GQvZypFeWQU6p4r1MJrJL+7tlG3DeA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1752142064; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X8wOSqp2tcorETbRhwjUnbU/crZZr8rxegSX7UhjIqc=; b=BDmPGUJgc2KXK2Sne+ymAA2vVAvoDHVQyJF7UrP4rcQBo5N0ecFJGBiTibO6ynABgruhhg fkZh8w9RVpIuugAg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1752142064; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X8wOSqp2tcorETbRhwjUnbU/crZZr8rxegSX7UhjIqc=; b=q/RAE2rPVrQ/+1sm3fYeuvRCWcxRuHYYi4MACWui7KQlYCEbxjaTVLuk/iLY8t0vBZVm7n uj8BjvgJi5+xn6yVrCro+bWOn8sTm0uEpxYC1STESNcKOgUSIZ/7j51c0MZe7mYXe+jRtx 0GQvZypFeWQU6p4r1MJrJL+7tlG3DeA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1752142064; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X8wOSqp2tcorETbRhwjUnbU/crZZr8rxegSX7UhjIqc=; b=BDmPGUJgc2KXK2Sne+ymAA2vVAvoDHVQyJF7UrP4rcQBo5N0ecFJGBiTibO6ynABgruhhg fkZh8w9RVpIuugAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 57B20136DC; Thu, 10 Jul 2025 10:07:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0Ew4FPCQb2jZWQAAD6G6ig (envelope-from ); Thu, 10 Jul 2025 10:07:44 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 058/103] ALSA: cs5535audio: Use safer strscpy() instead of strcpy() Date: Thu, 10 Jul 2025 12:06:40 +0200 Message-ID: <20250710100727.22653-59-tiwai@suse.de> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250710100727.22653-1-tiwai@suse.de> References: <20250710100727.22653-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:email,suse.de:mid]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLsqo7dymd5dgmoaprf5rep8is)]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-Spam-Score: -2.80 Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/cs5535audio/cs5535audio.c | 4 ++-- sound/pci/cs5535audio/cs5535audio_pcm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index 0f319013a2a2..76566e7baea0 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c @@ -315,9 +315,9 @@ static int __snd_cs5535audio_probe(struct pci_dev *pci, if (err < 0) return err; - strcpy(card->driver, DRIVER_NAME); + strscpy(card->driver, DRIVER_NAME); - strcpy(card->shortname, "CS5535 Audio"); + strscpy(card->shortname, "CS5535 Audio"); sprintf(card->longname, "%s %s at 0x%lx, irq %i", card->shortname, card->driver, cs5535au->port, cs5535au->irq); diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c index 9c88e99e3750..f296b2c63026 100644 --- a/sound/pci/cs5535audio/cs5535audio_pcm.c +++ b/sound/pci/cs5535audio/cs5535audio_pcm.c @@ -423,7 +423,7 @@ int snd_cs5535audio_pcm(struct cs5535audio *cs5535au) pcm->private_data = cs5535au; pcm->info_flags = 0; - strcpy(pcm->name, "CS5535 Audio"); + strscpy(pcm->name, "CS5535 Audio"); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &cs5535au->pci->dev, -- 2.50.0