Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K KIO
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 76
    • Merge requests 76
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FrameworksFrameworks
  • KIO
  • Merge requests
  • !1096

Fix integer overflow for large files in AccessManager

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Adrian Thiele requested to merge athiele/kio:fix-int-overflow into master Dec 29, 2022
  • Overview 2
  • Commits 1
  • Pipelines 4
  • Changes 1

When receiving a file that is 2147483648 bytes (2 GiB) or larger via KDE Connect it would not report transfer progress to the user and treat the transfer as failed as soon as it finished (and thus delete the received file).

The reason is an integer overflow of a signed integer and subsequent implicit conversion to an unsigned long long setting the total size of the transfer action to 2^{64}-1 bytes, which in turn prevents transfer progress signals to propagate to KDE Connect code (The uploadProgress signal never gets emitted in that case).

So we should treat the Content-Length header as an unsigned long long directly to prevent setting a wrong total size.

The fix has been tested by sending a 3 GiB large file from one Linux PC to another and from an android phone to a Linux PC via KDE Connect.

BUG: 452972

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-int-overflow