Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 824
    • Issues 824
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 30
    • Merge requests 30
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #13393
Closed
Open
Created Oct 12, 2014 by teor@teor

Avoid signed overflow in format_time_interval, add unit tests

I've discovered a signed overflow in format_time_interval while writing unit tests for it.

The signed overflow occurs when the function takes the absolute value of LONG_MIN (which is unlikely in practice). To avoid the overflow, I've patched it to use LONG_MAX when format_time_interval is passed LONG_MIN. (This doesn't change the output at all, as seconds aren't printed in this case.)

I've also created comprehensive unit tests.

tor version: 2.6.0-alpha tor git: f94e5f2e

I'll post the GitHub branch after I've created the changes file.

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