Skip to content

Conversation

@lbxl2345
Copy link

@lbxl2345 lbxl2345 commented Aug 1, 2019

These two functions may return wrong results if lines in the
file contains embedded '\0' characters.

For example, file "/proc/device-tree/compatible" could have
multiple values in one line (corresponding to the dts), and the
values are separated with '\0'.

In this situation, we need to replace the embedded '\0' and check
the entire line. If we don't do this, only the first value is
checked by strstr(), and the function may return false even if
the file contains certain content.

Signed-off-by: Benxi Liu [email protected]

These two functions may return wrong results if lines in the
file contains embedded '\0' characters.

For example, file "/proc/device-tree/compatible" could have
multiple values in one line (corresponding to the dts), and the
values are separated with '\0'.

In this situation, we need to replace the embedded '\0' and check
the entire line. If we don't do this, only the first value is
checked by strstr(), and the function may return false even if
the file contains certain content.

Signed-off-by: Benxi Liu <[email protected]>
@Mani-Sadhasivam Mani-Sadhasivam self-requested a review January 7, 2020 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant