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

View File

@ -1295,7 +1295,9 @@ relock:
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;
}