android/tester: Fix NULL dereference.

NULL pointer data->if_bluetooth will be dereferenced without return.
android/tester: Fix NULL dereference in socket setup

Add return statement to avoid NULL dereference in socket setup.
btinfo: Add missing socket close() on exit
btmon: Fix memory leak

Dynamic memory stored in company allocated through function
hwdb_get_company shall be freed.
btproxy: Fix closing invalid file descriptor

Instead of invalid file descriptor dst_fd close src_fd.
android/bluetooth: Fix browse_remote_sdp return value

False was converted to HAL_STATUS_SUCCESS resulting in wrong error
code in case of failure in handle_get_remote_services_cmd.
[travis-ci] Add configuration file
tools: Fix strncat() usage in hciconfig/hcitool

According to strncat() manpage:

"If src contains n or more characters, strncat() writes n+1 characters
to dest (n from src plus the terminating null byte).  Therefore, the
size of dest must be at least strlen(dest)+n+1"

While the current usage of strncat() cannot cause an overflow, if a
bigger string is added to the switch()'s without increasing the static
buffer, it would overflow by one byte due to the incorrect size
calculation.

Fixes clang errors like:

tools/hciconfig.c:827:33: error: the value of the size argument in
'strncat' is too large, might lead to a buffer overflow
[-Werror,-Wstrncat-size]
avrcp: Remove unnecessary "if (...)"

There is already a "if (type != 0x03 && type != 0x02)" check earlier on
the code, so a plain "if (...) else ..." is enough.

Fixes clang error:

profiles/audio/avrcp.c:2211:12: error: variable 'item' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
health: Fix struct mcap_csp "csp_req" field type

The values to which this field is set have nothing to do with MCAPCtrl.

Fixes clang error:

profiles/health/mcap_sync.c:767:24: error: comparison of constant 17
with expression of type 'MCAPCtrl' is always true
[-Werror,-Wtautological-constant-out-of-range-compare]
attrib: Fix sprintf() format specification

Fixes clang error:

src/attrib-server.c:916:26: error: format specifies type 'unsigned char'
but the argument has type 'uint16_t' (aka 'unsigned short')
[-Werror,-Wformat]
core: Fix sscanf() format specification

Also change the type of the "handle" variable so it is compatible with
the "%hu" specification used for sprintf() on the same function.

Fixes clang error:

src/adapter.c:3550:24: error: format specifies type 'unsigned short' but
the argument has type 'int' [-Werror,-Wformat]
tools: Fix unaligned memory access on smp-tester

Fixes clang errors like:

tools/smp-tester.c:263:11: error: cast from 'uint8_t *' (aka 'unsigned
char *') to 'u128 *' increases required alignment from 1 to 8
[-Werror,-Wcast-align]
tools: Fix possible uninitialized variable in obexctl

On set_default_session(), if g_dbus_proxy_get_property() returns FALSE,
desc will be uninitialized. Given that this function already checks for
NULL proxy internally, it is enough to check whether it fails (and if
so, set a default prompt without destination).

Fixes this clang error:

tools/obexctl.c:439:6: error: variable 'desc' is used uninitialized
whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
android/client: Fix incorrect usage of bt_state_t2str()

Fixes clang error:

android/client/if-bt.c:313:54: error: implicit conversion from
enumeration type 'bt_status_t' to different enumeration type
'bt_state_t' [-Werror,-Wenum-conversion]
android/client: Remove duplicate "const" specifier

Fixes clang errors like:

android/client/if-hh.c:181:39: error: duplicate 'const' declaration
specifier [-Werror,-Wduplicate-decl-specifier]
android/client: Use memcpy() for getting CMSG_DATA()

This is how it is done in all other places in BlueZ. Also drop
unnecessary "descs" local variable.

Fixes clang error:

android/client/if-sock.c:164:11: error: cast from 'unsigned char *' to
'int *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
android/client: Fix uninitialized "sock_fd" variable

If EXEC() macro is called with the first pointer argument NULL, sock_fd
will not be initialized. Given that the NULL check is not fatal, it is a
good idea to initialize the variable to -1 so the code has defined
behavior on this situation.

Detected by clang:

android/client/if-sock.c:251:7: error: variable 'sock_fd' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]