Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 587
    • Issues 587
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 95
    • Merge requests 95
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • 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 ProjectsISC Open Source Projects
  • BINDBIND
  • Merge requests
  • !3030

Fix comparison between type uint16_t and wider type size_t in a loop

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Ondřej Surý requested to merge ondrej/lgtm-narrow-vs-wider-type-comparison-in-a-loop-v9_14 into v9_14 Feb 10, 2020
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

Found by LGTM.com (see below for description), and while it should not happen as EDNS OPT RDLEN is uint16_t, the fix is easy. A little bit of cleanup is included too.

In a loop condition, comparison of a value of a narrow type with a value of a wide type may result in unexpected behavior if the wider value is sufficiently large (or small). This is because the narrower value may overflow. This can lead to an infinite loop.

(cherry picked from commit a9bd6f6e)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: ondrej/lgtm-narrow-vs-wider-type-comparison-in-a-loop-v9_14