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

i42: ut-core: ut_kvp_getListCount failure due to random count value. #42

Open
srinivasgtl opened this issue Aug 15, 2024 · 1 comment · May be fixed by #50
Open

i42: ut-core: ut_kvp_getListCount failure due to random count value. #42

srinivasgtl opened this issue Aug 15, 2024 · 1 comment · May be fixed by #50
Assignees
Labels
bug Something isn't working

Comments

@srinivasgtl
Copy link

srinivasgtl commented Aug 15, 2024

We had a situation where the API ut_kvp_getListCount has been triggered with some wrong profiles which will eventually fail. But the problem here is that the var count is not initialized due to which it generates a random value instead of zero during the failure. This random value created infinite loops in some of the VTS test cases.

Failure:
if (fy_node_is_sequence(node)) at line 600 fails due to some bad reason and as the count variable is not initialized, it will return a random value from here.

Solution: initialize the variable count to 0.

Please also check that the count is of type "uint32_t ", while we check this for -1 in certain cases.

 count = fy_node_sequence_item_count(node);
        if (count == -1)
        {
            UT_LOG_ERROR("fy_node_sequence_item_count() returned error\n ");
            return 0;
        }
@srinivasgtl srinivasgtl added the bug Something isn't working label Aug 15, 2024
@Ulrond Ulrond changed the title ut_kvp_getListCount failure due to random count value. i42: ut-core: ut_kvp_getListCount failure due to random count value. Sep 9, 2024
@kanjoe24
Copy link
Contributor

Hello @srinivasgtl , I have a PR for this issue. Can your team kindly test and provide me with feedback please.

Regards
Jyotsna

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants