[BusyBox] fdisk -l: SIGSEGV w/o /proc mounted

Marc Kleine-Budde kleine-budde at gmx.de
Fri Nov 14 16:30:39 UTC 2003


Hi!

Busybox fdisk segfaults if /proc is not mounted. It's in the
util-linux/fdisk.c around line 5645. Between the bb_wfopen and the
access to the fp should be some check.

I don't know what's the busybox way to do this, so I don't have fixed
it.

--------------<util-linux/fdisk.c>------------------------------
static void
tryprocpt(void) {
	FILE *procpt;
	char line[100], ptname[100], devname[120], *s;
	int ma, mi, sz;

	procpt = bb_wfopen(PROC_PARTITIONS, "r");

	while (fgets(line, sizeof(line), procpt)) {
		if (sscanf (line, " %d %d %d %[^\n ]",
--------------<util-linux/fdisk.c>------------------------------

marc

-- 
#!/bin/sh
set - `type $0` 'tr "[a-zA-Z]" "[n-za-mN-ZA-M]"';while [ "$2" != "" ];do \
shift;done; echo 'frq -a -rc '`echo "$0"| $1 `'>$UBZR/.`rpub signature|'`\
echo $1|$1`'`;rpub "Jr ner fvtangher bs obet. Erfvfgnapr vf shgvyr!"'|$1|sh



More information about the busybox mailing list