All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - clang: check for buffer existance
Date: Tue, 21 Sep 2021 19:50:59 +0000 (GMT)	[thread overview]
Message-ID: <20210921195059.69ECA3858D39@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=462ac47003e14975b91832f19bc287bd1a775bb4
Commit:        462ac47003e14975b91832f19bc287bd1a775bb4
Parent:        bb6fd1a15f32d79ddaa351704dea47ad9e5ab9be
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Sep 21 18:07:41 2021 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Sep 21 21:03:47 2021 +0200

clang: check for buffer existance

Make obvious to analyzer we can't get NULL here.
---
 daemons/dmeventd/dmeventd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 75672a7fd..46b3ff12f 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -678,6 +678,9 @@ static int _get_status(struct message_data *message_data)
 	char **buffers;
 	char *message;
 
+	if (!message_data->id)
+		return -EINVAL;
+
 	_lock_mutex();
 	count = dm_list_size(&_thread_registry);
 	buffers = alloca(sizeof(char*) * count);



                 reply	other threads:[~2021-09-21 19:50 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=20210921195059.69ECA3858D39@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.