Skip to content

Conversation

bkucman
Copy link
Contributor

@bkucman bkucman commented Apr 16, 2025

string2ibpi does not compare strings correctly, the function uses strncmp, which in case strings of different lengths, may return incorrect value if substrings of given max length are identical. In this function whole strings must be identical.

Fix is to change strncmp to strcmp.

Fixes #259
Fixes: 9481845 ("Add struct for mapping ibpi statuses to strings. (#211)")
Signed-off-by: Blazej Kucman blazej.kucman@intel.com

string2ibpi does not compare strings correctly, the function uses strncmp,
which in case strings of different lengths, may return incorrect value
if substrings of given max length are identical. In this function whole
strings must be identical.

Fix is to change strncmp to strcmp.

Fixes intel#259
Fixes: 9481845 ("Add struct for mapping ibpi statuses to strings. (intel#211)")
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
Copy link

@nicholasyang2022 nicholasyang2022 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@bkucman bkucman requested a review from rsobans April 18, 2025 10:14
@bkucman bkucman merged commit 740a352 into intel:main Apr 22, 2025
11 checks passed
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.

string2ibpi does not compare strings correctly and ledctl locate_off does not work

3 participants