summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2017-07-18 16:41:43 +0200
committerYann Ylavic <ylavic@apache.org>2017-07-18 16:41:43 +0200
commit7f548a8cdae026d87acc140c342d47009a143d33 (patch)
tree5e3c89ade63a319e92f8bc16d1373abb3ecd7643
parentFix overriding ExtendedStatus to "off" with mod_systemd loaded, and (diff)
downloadapache2-7f548a8cdae026d87acc140c342d47009a143d33.tar.xz
apache2-7f548a8cdae026d87acc140c342d47009a143d33.zip
Be explicit and safe (const) with the strings stored in ap_server_config_defines.
Follow up to r1713043. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1802305 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--server/core.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/core.c b/server/core.c
index cf2c28f5f0..76adb4d869 100644
--- a/server/core.c
+++ b/server/core.c
@@ -1481,8 +1481,7 @@ static const char *set_define(cmd_parms *cmd, void *dummy,
init_config_defines(cmd->pool);
}
if (!ap_exists_config_define(name)) {
- const char **newv = (const char **)apr_array_push(ap_server_config_defines);
- *newv = name;
+ *(const char **)apr_array_push(ap_server_config_defines) = name;
}
if (value) {
if (!server_config_defined_vars) {
@@ -1498,7 +1497,7 @@ static const char *unset_define(cmd_parms *cmd, void *dummy,
const char *name)
{
int i;
- char **defines;
+ const char **defines;
if (cmd->parent && ap_cstr_casecmp(cmd->parent->directive, "<VirtualHost")) {
return apr_pstrcat(cmd->pool, cmd->cmd->name, " is not valid in ",
cmd->parent->directive, " context", NULL);
@@ -1512,10 +1511,10 @@ static const char *unset_define(cmd_parms *cmd, void *dummy,
init_config_defines(cmd->pool);
}
- defines = (char **)ap_server_config_defines->elts;
+ defines = (const char **)ap_server_config_defines->elts;
for (i = 0; i < ap_server_config_defines->nelts; i++) {
if (strcmp(defines[i], name) == 0) {
- defines[i] = *(char **)apr_array_pop(ap_server_config_defines);
+ defines[i] = *(const char **)apr_array_pop(ap_server_config_defines);
break;
}
}