Windows: AFSCreate avoid race leading to NULL dereference
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 4 Sep 2013 17:11:24 +0000 (13:11 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 28 Sep 2013 02:21:15 +0000 (19:21 -0700)
commit7efd78539066bedeeb3b579a613d587d8aa6e623
tree4d921df3ae58e20a7c6d33313b4906ec9756eef9
parent8e32b11be6ce0517f75588360a3ca8c333358ca3
Windows: AFSCreate avoid race leading to NULL dereference

If a test for NULL is performed ahead of an assignment and then
use of the assigned value, there is a race which can result in
the assigned value being NULL if the value being assigned is
altered by another thread.

Perform the assignment first then test based upon that.

Change-Id: I6d50619dab168c2aa12542b14217779f1be08ee9
Reviewed-on: http://gerrit.openafs.org/10296
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp