hal: Minor usb stability fix

- Adding buffer of one byte for the strstr usecase to make
  the passed string is NULL terminated.

Change-Id: Ief8531e149b05f4020cb1338110bbfad4a74f7d0
Crs-fixed: 607454
This commit is contained in:
Apoorv Raghuvanshi 2014-01-29 15:31:32 -08:00
parent 2d477702a8
commit dad3b78df2
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ static int usb_get_capability(char *type, int32_t *channels,
file_size = st.st_size;
read_buf = (char *)calloc(1, USB_BUFF_SIZE);
read_buf = (char *)calloc(1, USB_BUFF_SIZE + 1);
err = read(fd, read_buf, USB_BUFF_SIZE);
str_start = strstr(read_buf, type);
if (str_start == NULL) {