Fix crash with Linux supermount fstab entries (thanks Erno!)
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40248
This commit is contained in:
parent
0ed6cab836
commit
0d4c3555ab
1 changed files with 14 additions and 8 deletions
|
@ -203,21 +203,27 @@ static void CheckMounts(const char *mtab)
|
||||||
if ( strcmp(mnt_type, MNTTYPE_SUPER) == 0 ) {
|
if ( strcmp(mnt_type, MNTTYPE_SUPER) == 0 ) {
|
||||||
tmp = strstr(mntent->mnt_opts, "fs=");
|
tmp = strstr(mntent->mnt_opts, "fs=");
|
||||||
if ( tmp ) {
|
if ( tmp ) {
|
||||||
strcpy(mnt_type, tmp+strlen("fs="));
|
free(mnt_type);
|
||||||
|
mnt_type = strdup(tmp + strlen("fs="));
|
||||||
|
if ( mnt_type ) {
|
||||||
tmp = strchr(mnt_type, ',');
|
tmp = strchr(mnt_type, ',');
|
||||||
if ( tmp ) {
|
if ( tmp ) {
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
tmp = strstr(mntent->mnt_opts, "dev=");
|
tmp = strstr(mntent->mnt_opts, "dev=");
|
||||||
if ( tmp ) {
|
if ( tmp ) {
|
||||||
strcpy(mnt_dev, tmp+strlen("dev="));
|
free(mnt_dev);
|
||||||
|
mnt_dev = strdup(tmp + strlen("dev="));
|
||||||
|
if ( mnt_dev ) {
|
||||||
tmp = strchr(mnt_dev, ',');
|
tmp = strchr(mnt_dev, ',');
|
||||||
if ( tmp ) {
|
if ( tmp ) {
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ( strcmp(mnt_type, MNTTYPE_CDROM) == 0 ) {
|
if ( strcmp(mnt_type, MNTTYPE_CDROM) == 0 ) {
|
||||||
#ifdef DEBUG_CDROM
|
#ifdef DEBUG_CDROM
|
||||||
fprintf(stderr, "Checking mount path from %s: %s mounted on %s of %s\n",
|
fprintf(stderr, "Checking mount path from %s: %s mounted on %s of %s\n",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue