}
++mp;
}
- if (mtpt)
+ if (mtpt && n >= 0)
xstrncpy(mtpt, mp->f_mntonname, mtlen);
return 0;
}
/*
- * check_mount_point() fills determines if the device is mounted or otherwise
+ * check_mount_point() determines if the device is mounted or otherwise
* busy, and fills in mount_flags with one or more of the following flags:
* MF_MOUNTED, MF_ISROOT, MF_READONLY, MF_SWAP, and MF_BUSY. If mtpt is
* non-NULL, the directory where the device is mounted is copied to where mtpt