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 Changed 6 years ago by jessicah

Has a Patch: set

comment:2 Changed 6 years ago by anevilyak

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 Changed 6 years ago by dsjonny

Maybe duplicate: #9557

comment:4 Changed 6 years ago by jessicah

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

Changed 6 years ago by jessicah

Attachment: 0001-Fixes-9673.patch added

comment:5 Changed 6 years ago by jessicah

Blocking: 9557 added

Updated patch to use strtoll.

comment:6 Changed 6 years ago by kallisti5

Owner: changed from stippi to kallisti5
Status: newassigned

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

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 Changed 6 years ago by jessicah

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 Changed 6 years ago by anevilyak

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.