On Wed, Aug 18, 2010 at 4:10 PM, <sf@apache.org> wrote:
Author: sf
Date: Wed Aug 18 20:10:12 2010
New Revision: 986901

URL: http://svn.apache.org/viewvc?rev=986901&view=rev
Log:
Perform NULL check before dereferencing arg, not after.

PR: 49634

Modified:
   httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=986901&r1=986900&r2=986901&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Wed Aug 18 20:10:12 2010
@@ -1735,11 +1735,7 @@ static const char *dirsection(cmd_parms

    arg = apr_pstrndup(cmd->pool, arg, endp - arg);

-    if (!arg[0]) {
-        return missing_container_arg(cmd);
-    }
-
-    if (!arg) {
+    if (!arg || !arg[0]) {
        if (thiscmd->cmd_data)
            return "<DirectoryMatch > block must specify a path";
        else

Wasn't the right fix to simply remove the dead code below?  (IOW, there was no dereference of a NULL pointer.)

    if ( !arg) {
        if (thiscmd->cmd_data)
            return "<DirectoryMatch > block must specify a path";
        else
            return "<Directory > block must specify a path";
    }