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

types: improve comparison reliability of binary strings #168

Merged
merged 1 commit into from
Aug 22, 2023

Commits on Aug 22, 2023

  1. types: improve comparison reliability of binary strings

    The existing `ucv_compare()` implementation utilized `strcmp()` to compare
    two ucode string values, which may lead to incorrect results for strings
    containing null bytes as the comparison prematurely aborts when encountering
    the first null.
    
    Rework the string comparison logic to use `memcmp()` for comparing both ucv
    strings with each other in order to ensure that expressions such as
    `"" == "\u0000"` lead to the expected `false` result.
    
    Ref: openwrt/luci#6530
    Signed-off-by: Jo-Philipp Wich <[email protected]>
    jow- committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    8f852ea View commit details
    Browse the repository at this point in the history