Opened 6 years ago

Closed 6 years ago

#9673 closed bug (fixed)

DriveSetup: integer overflow in slider for partition size

Reported by: jessicah Owned by: kallisti5
Priority: normal Milestone: R1
Component: Applications/DriveSetup Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #9557
Has a Patch: yes Platform: All

Description


Attachments (1)

0001-Fixes-9673.patch (909 bytes ) - added by jessicah 6 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by jessicah, 6 years ago

Has a Patch: set

comment:2 by anevilyak, 6 years ago

Wouldn't it make more sense to just replace the use of atoi() with strtoll()? The cast isn't going to solve the fact that atoi() isn't going to be able to parse that large of a value range and return a correct value to begin with.

comment:3 by dsjonny, 6 years ago

Maybe duplicate: #9557

comment:4 by jessicah, 6 years ago

Hmm, okay, I'll change it to strtoll, although the value is in 1MB increments... scary to imagine storage that large!

by jessicah, 6 years ago

Attachment: 0001-Fixes-9673.patch added

comment:5 by jessicah, 6 years ago

Blocking: 9557 added

Updated patch to use strtoll.

comment:6 by kallisti5, 6 years ago

Owner: changed from stippi to kallisti5
Status: newassigned

in reply to:  4 comment:7 by anevilyak, 6 years ago

Replying to jessicah:

Hmm, okay, I'll change it to strtoll, although the value is in 1MB increments... scary to imagine storage that large!

If that's the case then how were you in fact observing an overflow? The original patch was a no-op since off_t is already 64-bit, so the cast from int to off_t was done by the compiler implicitly anyways.

comment:8 by jessicah, 6 years ago

You'd think so, but I was printing it out, and it was indeed overflowing. Looks like the implicit cast happened after the multiplication, not before.

comment:9 by anevilyak, 6 years ago

Resolution: fixed
Status: assignedclosed

Oops, missed that detail, it was a long day. Oh well, we're ready for the day > 2PB hard disks hit the market I suppose :)

Note: See TracTickets for help on using tickets.