From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v2] monitor: Fix invalid access
Date: Mon, 8 Mar 2021 14:42:28 -0800 [thread overview]
Message-ID: <20210308224228.344888-1-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
ident can be NULL when printing user logs which may lead ot invalid
access.
Fixes: https://github.com/bluez/bluez/issues/92
---
monitor/packet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/monitor/packet.c b/monitor/packet.c
index a72b424fe..8b87d3d8b 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -11306,7 +11306,7 @@ void packet_user_logging(struct timeval *tv, struct ucred *cred,
label = "Message";
}
- if (ident[0] == '<' || ident[0] == '>') {
+ if (ident && (ident[0] == '<' || ident[0] == '>')) {
packet_decode(tv, cred, ident[0], index, color,
label == ident ? &ident[2] : label,
data, size);
--
2.29.2
next reply other threads:[~2021-03-08 22:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 22:42 Luiz Augusto von Dentz [this message]
2021-03-08 23:00 ` [v2] monitor: Fix invalid access bluez.test.bot
2021-03-08 23:33 ` Luiz Augusto von Dentz
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=20210308224228.344888-1-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/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.