mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karim Eshapa <karim.eshapa@gmail.com>
To: robert.moore@intel.com
Cc: lv.zheng@intel.com, rafael.j.wysocki@intel.com, lenb@kernel.org,
	linux-acpi@vger.kernel.org, devel@acpica.org,
	linux-kernel@vger.kernel.org,
	Karim Eshapa <karim.eshapa@gmail.com>
Subject: [PATCH] acpi: acpica: dbfileio: Use strlcpy to Copy a C-string into a sized buffer
Date: Wed, 24 May 2017 01:25:53 +0200	[thread overview]
Message-ID: <1495581953-5523-1-git-send-email-karim.eshapa@gmail.com> (raw)

Use strlcpy with sized buffer instead of strncpy to
avoid non NUL-terminated source strings problems.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
 drivers/acpi/acpica/dbfileio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/dbfileio.c b/drivers/acpi/acpica/dbfileio.c
index 4d81ea2..f0f22f1 100644
--- a/drivers/acpi/acpica/dbfileio.c
+++ b/drivers/acpi/acpica/dbfileio.c
@@ -99,7 +99,7 @@ void acpi_db_open_debug_file(char *name)
 	}
 
 	acpi_os_printf("Debug output file %s opened\n", name);
-	strncpy(acpi_gbl_db_debug_filename, name,
+	strlcpy(acpi_gbl_db_debug_filename, name,
 		sizeof(acpi_gbl_db_debug_filename));
 	acpi_gbl_db_output_to_file = TRUE;
 }
-- 
2.7.4

             reply	other threads:[~2017-05-23 23:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 23:25 Karim Eshapa [this message]
2017-05-24 14:15 ` Moore, Robert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495581953-5523-1-git-send-email-karim.eshapa@gmail.com \
    --to=karim.eshapa@gmail.com \
    --cc=devel@acpica.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®