8335b1
diff --git a/server/core.c b/server/core.c
8335b1
index f60e8fa..245fcb6 100644
8335b1
--- a/server/core.c
8335b1
+++ b/server/core.c
8335b1
@@ -2061,6 +2061,12 @@ AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd,
8335b1
             /* method has not been registered yet, but resorce restriction
8335b1
              * is always checked before method handling, so register it.
8335b1
              */
8335b1
+            if (cmd->pool == cmd->temp_pool) {
8335b1
+                /* In .htaccess, we can't globally register new methods. */
8335b1
+                return apr_psprintf(cmd->pool, "Could not register method '%s' "
8335b1
+                                    "for %s from .htaccess configuration",
8335b1
+                                     method, cmd->cmd->name);
8335b1
+            }
8335b1
             methnum = ap_method_register(cmd->pool,
8335b1
                                          apr_pstrdup(cmd->pool, method));
8335b1
         }