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

NULL Pointer Dereference vulnerability in void repodata_search_keyskip(), src/repodata.c #582

Open
QiuYitai opened this issue Mar 11, 2025 · 0 comments

Comments

@QiuYitai
Copy link

The NULL Dereference vulnerability happens in void repodata_search_keyskip(), src/repodata.c
How the NULL Pointer Dereference happens:

  1. When the function repodata_search calls repodata_search_keyskip and passes *keyskip, the value of *keyskip is 0.
  2. kv.parentis set to NULL at kv.parent = (KeyValue *)keyskip;
  3. Dereference of NULL variable kv.parent in schema = kv.parent->id;
void
repodata_search(Repodata *data, Id solvid, Id keyname, int flags, int (*callback)
                (void *cbdata, Solvable *s, Repodata *data, Repokey *key, 
                    KeyValue *kv), void *cbdata)
{
=> repodata_search_keyskip(data, solvid, keyname, flags, 0, callback, cbdata);
}

void
repodata_search_keyskip(Repodata *data, Id solvid, Id keyname, int flags, 
                        Id *keyskip, int (*callback)(void *cbdata, Solvable *s, 
                        Repodata *data, Repokey *key, KeyValue *kv), void *cbdata)
{
      Id schema;
      Repokey *key;
      Id keyid, *kp, *keyp;
      unsigned char *dp, *ddp;
      int onekey = 0;
      int stop;
      KeyValue kv;
      Solvable *s;

      if (!maybe_load_repodata(data, keyname))
        return;
=>    if ((flags & SEARCH_SUBSCHEMA) != 0)
      {
          flags ^= SEARCH_SUBSCHEMA;
=>        kv.parent = (KeyValue *)keyskip;
          keyskip = 0;
=>        schema = kv.parent->id;
          dp = (unsigned char *)kv.parent->str;
      }
      else
      {
          ......
      }
      ......
}
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

No branches or pull requests

1 participant