From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] android/tester: Fix possible NULL pointer passing to function
Date: Thu, 9 Oct 2014 13:16:52 +0300 [thread overview]
Message-ID: <1412849812-6498-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> (raw)
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Silence code analyzers and follow strict C standard where passing NULL
pointer results in undefined behaviour.
---
android/tester-main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/android/tester-main.c b/android/tester-main.c
index 30e1c59..ee3444f 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
@@ -801,12 +801,12 @@ static bool match_data(struct step *step)
return false;
}
- if (exp->store_srvc_handle)
+ if (exp->store_srvc_handle && step->callback_result.srvc_handle)
memcpy(exp->store_srvc_handle,
step->callback_result.srvc_handle,
sizeof(*exp->store_srvc_handle));
- if (exp->store_char_handle)
+ if (exp->store_char_handle && step->callback_result.char_handle)
memcpy(exp->store_char_handle,
step->callback_result.char_handle,
sizeof(*exp->store_char_handle));
--
1.9.1
next reply other threads:[~2014-10-09 10:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-09 10:16 Andrei Emeltchenko [this message]
2014-10-09 10:56 ` [PATCH] android/tester: Fix possible NULL pointer passing to function Grzegorz Kolodziejczyk
2014-10-09 11:20 ` Andrei Emeltchenko
2014-10-09 11:26 ` Grzegorz Kolodziejczyk
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=1412849812-6498-1-git-send-email-Andrei.Emeltchenko.news@gmail.com \
--to=andrei.emeltchenko.news@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox