Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dad3b78d authored by Apoorv Raghuvanshi's avatar Apoorv Raghuvanshi
Browse files

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
parent 2d477702
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {