Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_bt
Commits
0e888661
Commit
0e888661
authored
9 years ago
by
Andre Eisenbach
Browse files
Options
Download
Email Patches
Plain Diff
Instrument and fix calls to strncmp()
Bug: 27222508 Change-Id: I0075b4480aff52dcdc326b7bdb7154ca919ccee9
parent
b1f50e1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
btif/src/bluetooth.c
btif/src/bluetooth.c
+9
-8
stack/btm/btm_sec.c
stack/btm/btm_sec.c
+1
-0
No files found.
btif/src/bluetooth.c
View file @
0e888661
...
...
@@ -27,6 +27,7 @@
#define LOG_NDDEBUG 0
#define LOG_TAG "bt_btif"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -63,12 +64,6 @@
#include "btif/include/btif_debug_conn.h"
#include "btif/include/btif_media.h"
/************************************************************************************
** Constants & Macros
************************************************************************************/
#define is_profile(profile, str) ((strlen(str) == strlen(profile)) && strncmp((const char *)profile, str, strlen(str)) == 0)
/************************************************************************************
** Static variables
************************************************************************************/
...
...
@@ -117,6 +112,12 @@ static bool interface_ready(void) {
return
bt_hal_cbacks
!=
NULL
;
}
static
bool
is_profile
(
const
char
*
p1
,
const
char
*
p2
)
{
assert
(
p1
);
assert
(
p2
);
return
strlen
(
p1
)
==
strlen
(
p2
)
&&
strncmp
(
p1
,
p2
,
strlen
(
p2
))
==
0
;
}
/*****************************************************************************
**
** BLUETOOTH HAL INTERFACE FUNCTIONS
...
...
@@ -328,11 +329,11 @@ static int read_energy_info()
static
void
dump
(
int
fd
,
const
char
**
arguments
)
{
if
(
arguments
!=
NULL
&&
arguments
[
0
]
!=
NULL
)
{
if
(
strncmp
(
arguments
[
0
],
"--proto-text"
,
1
1
)
==
0
)
{
if
(
strncmp
(
arguments
[
0
],
"--proto-text"
,
1
2
)
==
0
)
{
metrics_print
(
fd
,
true
);
return
;
}
if
(
strncmp
(
arguments
[
0
],
"--proto-bin"
,
1
0
)
==
0
)
{
if
(
strncmp
(
arguments
[
0
],
"--proto-bin"
,
1
1
)
==
0
)
{
metrics_write
(
fd
,
true
);
return
;
}
...
...
This diff is collapsed.
Click to expand it.
stack/btm/btm_sec.c
View file @
0e888661
...
...
@@ -559,6 +559,7 @@ static BOOLEAN btm_sec_set_security_level (CONNECTION_TYPE conn_type, char *p_na
if
(
p_srec
->
psm
==
psm
&&
p_srec
->
mx_proto_id
==
mx_proto_id
&&
service_id
==
p_srec
->
service_id
&&
p_name
&&
(
!
strncmp
(
p_name
,
(
char
*
)
p_srec
->
orig_service_name
,
BTM_SEC_SERVICE_NAME_LEN
)
||
!
strncmp
(
p_name
,
(
char
*
)
p_srec
->
term_service_name
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment