Opened 12 years ago
Closed 12 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 | |
Platform: | All |
Description
Attachments (1)
Change History (10)
comment:1 by , 12 years ago
patch: | 0 → 1 |
---|
comment:2 by , 12 years ago
follow-up: 7 comment:4 by , 12 years ago
Hmm, okay, I'll change it to strtoll, although the value is in 1MB increments... scary to imagine storage that large!
by , 12 years ago
Attachment: | 0001-Fixes-9673.patch added |
---|
comment:6 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:7 by , 12 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 , 12 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 , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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 :)
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.