All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - cov: fix buffer size usage
Date: Tue, 20 Dec 2022 15:23:35 +0000 (GMT)	[thread overview]
Message-ID: <20221220152335.623323858000@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f443d16fd7409b46b77be2aa74090ab558c51425
Commit:        f443d16fd7409b46b77be2aa74090ab558c51425
Parent:        44a2f2df9281ac0f5aef67d5f3c32fc2ee6ad0e9
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Dec 20 13:58:31 2022 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Dec 20 15:04:36 2022 +0100

cov: fix buffer size usage

Count with extra 1 byte for buffer end '\0'.
---
 libdm/dm-tools/dmfilemapd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdm/dm-tools/dmfilemapd.c b/libdm/dm-tools/dmfilemapd.c
index d547e59d5..f6c04e03e 100644
--- a/libdm/dm-tools/dmfilemapd.c
+++ b/libdm/dm-tools/dmfilemapd.c
@@ -172,7 +172,7 @@ static int _is_open_in_pid(pid_t pid, const char *path)
 		if (pid_dp->d_name[0] == '.')
 			continue;
 		if ((len = readlinkat(dirfd(pid_d), pid_dp->d_name, link_buf,
-				      sizeof(link_buf))) < 0) {
+				      (sizeof(link_buf) - 1))) < 0) {
 			log_error("readlink failed for " DEFAULT_PROC_DIR
 				  "/%d/fd/.", pid);
 			goto bad;


                 reply	other threads:[~2022-12-20 15:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221220152335.623323858000@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.