cfdisk crashes if terminal size is too small
Bug #9999 reported by
Danilo Piazzalunga
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
util-linux (Ubuntu) |
Fix Released
|
Medium
|
LaMont Jones |
Bug Description
Hello,
I've tried to run cfdisk in a narrow (less than 40 columns) gnome-terminal window,
and cfdisk crashed.
If the user doesn't have rights to read the device, the crash doesn't occur, because
the program merely displays an error message. It can be reproduced only when
actually
seeing the partition layout of a device.
The problem is caused by some (unsafe) usage of sprintf. The patch I'm going to
attach
changes most unsafe sprintf calls to snprintf, and it looks like the bug is solved.
The considered util-linux version is 2.12h-3ubuntu1.
To post a comment you must log in.
Created an attachment (id=718)
Changes unsafe sprintf calls to snprintf
This is the patch against util-linux 2.12h-3ubuntu1 for cfdisk.