Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devices/sensors /libsensors-spi.c: problematic use of the sprintf() function #1006

Open
kemonats opened this issue Feb 11, 2024 · 0 comments · May be fixed by phoenix-rtos/phoenix-rtos-devices#516
Assignees

Comments

@kemonats
Copy link
Contributor

In this lines argument 3 overlaps destination object.
https://github.com/phoenix-rtos/phoenix-rtos-devices/blob/ac27d41c70aceca307401aa66047b988da6f044a/sensors/libsensors-spi.c#L110

        sprintf(dir, "%s/dir", dir);

https://github.com/phoenix-rtos/phoenix-rtos-devices/blob/ac27d41c70aceca307401aa66047b988da6f044a/sensors/libsensors-spi.c#L130

        sprintf(dir, "%s/port", dir);

Better will be use of the strcat() or strlen() + strcpy()

@agkaminski agkaminski assigned agkaminski and niewim19 and unassigned agkaminski Feb 12, 2024
@badochov badochov linked a pull request Sep 27, 2024 that will close this issue
14 tasks
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 a pull request may close this issue.

3 participants