1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

v_mountedhere is a member of the union. Check that the vnodes have

proper type before using the member.

Reported and tested by:	Michael Butler <imb protected-networks net>
This commit is contained in:
Konstantin Belousov 2011-02-19 07:47:25 +00:00
parent ee320f98a9
commit c30c6a2311
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218838

View File

@ -1295,7 +1295,9 @@ ufs_rename(ap)
newparent = tdp->i_number;
doingdirectory = 1;
}
if (fvp->v_mountedhere != NULL || (tvp && tvp->v_mountedhere != NULL)) {
if ((fvp->v_type == VDIR && fvp->v_mountedhere != NULL) ||
(tvp != NULL && tvp->v_type == VDIR &&
tvp->v_mountedhere != NULL)) {
error = EXDEV;
goto unlockout;
}