Static code analysis cleanups and minor bug fixes
- Fix for initializing all the un-initialized variables
- Handling system call failure like socket,fcntl etc...
- In btpan_tap_close validate tap_if_down and close the socket.
- Invalid memset size, which could have potential memory issue
- Change -1 to INVALID_FD where appropriate
Bug: 19417758
Change-Id: Id31832f8678b2d72c80740c29b946a94e7ae0197
diff --git a/btif/src/btif_rc.c b/btif/src/btif_rc.c
index 341356f..781de35 100644
--- a/btif/src/btif_rc.c
+++ b/btif/src/btif_rc.c
@@ -289,7 +289,7 @@
}
memset(&dev, 0, sizeof(dev));
if (name)
- strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE);
+ strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE-1);
dev.id.bustype = BUS_BLUETOOTH;
dev.id.vendor = 0x0000;