Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #6853

Closed (moved)
(moved)
Open
Created Sep 15, 2012 by Robert Ransom@rransom

Relay-flag voting code has undefined behaviour

After Nick found and fixed #6833 (moved), the bughunter with many names pointed out that the following code still has undefined behaviour, even with j known to be less than the bit width of *flags_out:

          *flags_out |= (1<<j);

The problem is that 1 has type int, so on platforms where int only has 32 bits (i.e. almost all of them), this still tries to shift by more than the width of the type in one fell swoop.

This undefined behaviour is probably lurking in everything that touches this flags field, not just the parsing goo.

Marking as 0.2.4.x-only for now, but this should definitely be backported to a future 0.2.3-da branch.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking