]> granicus.if.org Git - apache/commitdiff
Whoops, head off a potential segfault. The array is only
authorKen Coar <coar@apache.org>
Thu, 10 Aug 2000 13:28:45 +0000 (13:28 +0000)
committerKen Coar <coar@apache.org>
Thu, 10 Aug 2000 13:28:45 +0000 (13:28 +0000)
created at need, so check for its existence before trying
to peek into it.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86047 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_protocol.c

index 40bfb9d1181e04c0babb4ed0523e9dbdb733d828..6be3e7225d76201635753263c0e7b09c3c80f6d5 100644 (file)
@@ -1591,7 +1591,9 @@ static char *make_allow(request_rec *r)
                       (r->allowed & (1 << M_UNLOCK))    ? ", UNLOCK"    : "",
                       ", TRACE",
                       NULL);
-    if ((r->allowed & (1 << M_INVALID)) && (r->allowed_xmethods->nelts)) {
+    if ((r->allowed & (1 << M_INVALID))
+       && (r->allowed_xmethods != NULL)
+       && (r->allowed_xmethods->nelts != 0)) {
        int i;
        char **xmethod = (char **) r->allowed_xmethods->elts;