Reduce a race condition... We doubly protect against a bogus vhostrec
pointer. The first test sets the pointer correctly no matter what the value of vhostrec. When it's time to print out, we check again. If the previous value was NULL, then no matter what, "NULL" will be used for the hostname, even if the new vhostrec was changed between the 2 tests to be valid. If the previous was OK, then the vhost value will only be printed if it's still OK. There's still a window between this final test and when the actual string is printed, since it's possible (maybe) that right after the test, the vhostrec is no longer valid, but assuming that the memory hasn't been released or overwritten, we still point to a good string. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@82441 13f79535-47bb-0310-9956-ffa450edef68
Loading
Please sign in to comment