Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 522
    • Issues 522
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 99
    • Merge requests 99
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source Projects
  • BINDBIND
  • Issues
  • #168

Closed
Open
Created Mar 19, 2018 by Ghost User@ghost

coverity: Incorrect shifting in DNS_RPZ_ZMASK

________________________________________________________________________________________________________
*** CID 1430160:    (BAD_SHIFT)
/lib/ns/query.c: 2610 in rpz_get_zbits()
2604             *      the smallest name,
2605             *      the longest IP address prefix,
2606             *      the lexically smallest address.
2607             */
2608            if (st->m.policy != DNS_RPZ_POLICY_MISS) {
2609                    if (st->m.type >= rpz_type) {
>>>     CID 1430160:    (BAD_SHIFT)
>>>     In expression "1 << st->m.rpz->num + 1", left shifting by more than 31 bits has undefined behavior.  The shift amount, "st->m.rpz->num + 1", is as much as 63.
2610                            zbits &= DNS_RPZ_ZMASK(st->m.rpz->num);
2611                    } else{
2612                            zbits &= DNS_RPZ_ZMASK(st->m.rpz->num) >> 1;
2613                    }
2614            }
2615
/lib/ns/query.c: 2612 in rpz_get_zbits()
2606             *	the lexically smallest address.
2607             */
2608            if (st->m.policy != DNS_RPZ_POLICY_MISS) {
2609                    if (st->m.type >= rpz_type) {
2610                            zbits &= DNS_RPZ_ZMASK(st->m.rpz->num);
2611                    } else{
>>>     CID 1430160:    (BAD_SHIFT)
>>>     In expression "1 << st->m.rpz->num + 1", left shifting by more than 31 bits has undefined behavior.  The shift amount, "st->m.rpz->num + 1", is as much as 63.
2612                            zbits &= DNS_RPZ_ZMASK(st->m.rpz->num) >> 1;
2613                    }
2614            }
2615
2616            /*
2617             * If the client wants recursion, allow only compatible policies.
Edited Mar 19, 2018 by Ghost User
Assignee
Assign to
Time tracking