Bluetooth: Properly initialize UART fds

If the vendor library is unable to open the UART,
the passed in file descriptor array is unchanged.
This array was uninitialized stack memory which
may miss the illegal fd check and barrel ahead
forking a userial read thread causing FD_SET
problems should the uninitialized stack memory be
bogus fds outside the processes boundaries.
Verify that the vendor library was actually opening
exactly one uart.

Bug: 16651586

Change-Id: I24e700cdb0b0f3ed107f56b94b5b535abba66806
diff --git a/hci/src/userial.c b/hci/src/userial.c
index 4c2a8db..34de045 100644
--- a/hci/src/userial.c
+++ b/hci/src/userial.c
@@ -281,9 +281,12 @@
 
     // Call in to the vendor-specific library to open the serial port.
     int fd_array[CH_MAX];
+    for (int i = 0; i < CH_MAX; i++)
+        fd_array[i] = -1;
+
     int num_ports = vendor_send_command(BT_VND_OP_USERIAL_OPEN, &fd_array);
 
-    if (num_ports > 1) {
+    if (num_ports != 1) {
         ALOGE("%s opened wrong number of ports: got %d, expected 1.", __func__, num_ports);
         goto error;
     }