Skip to content

null-pointer failure in rb_sort_clb #2471

Open

Description

@w00931306

/**

  • @brief Call plugins_types sort callback or sort values by plugin order.
  • @PARAM[in] ctx libyang context.
  • @PARAM[in] val1 First value to compare.
  • @PARAM[in] val2 Second value to compare.
  • @return Negative number if val1 < val2,
  • @return Zero if val1 == val2,
  • @return Positive number if val1 > val2.
    */
    static int
    in (const struct ly_ctx *ctx, const struct lyd_value *val1, const struct lyd_value *val2)
    {
    assert(val1->realtype == val2->realtype);
    return val1->realtype->plugin->sort(ctx, val1, val2);
    }

we met null-poniter failure when using the interface lyds_merge, we find the val1 could be null-pointer. How should we perform a NULL check on the input parameter.

Best wishes,
ciao

Activity

  1. michalvasko commented on Jan 16, 2026

    @michalvasko
    Member

    What exactly were you doing? You are not supposed to call lyds_merge() or any other internal functions yourself.

  2. added
    is:bugBug description.
    status:invalidIssue is not reproducible or the behavior is intended.
    on Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:bugBug description.status:invalidIssue is not reproducible or the behavior is intended.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions