You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the code tries to compare a user specified hex value against "0x". eg, if user specify "0x80", the code tries to do strcmp("0x80", "0x"), and expect it to return 0. However, it seems strcmp() will return 0, if and only if two strings are exactly same. For this particular usage, I suggest to change the code to strncmp(type, "0x", 2); to force it to only compare first two characters.
The text was updated successfully, but these errors were encountered:
ipmitool/lib/ipmi_sdr.c
Line 4584 in 39ca56b
the code tries to compare a user specified hex value against "0x". eg, if user specify "0x80", the code tries to do strcmp("0x80", "0x"), and expect it to return 0. However, it seems strcmp() will return 0, if and only if two strings are exactly same. For this particular usage, I suggest to change the code to strncmp(type, "0x", 2); to force it to only compare first two characters.
The text was updated successfully, but these errors were encountered: