diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp_config.c | 6 | ||||
| -rw-r--r-- | src/sp_config.h | 2 | ||||
| -rw-r--r-- | src/sp_config_keywords.c | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/sp_config.c b/src/sp_config.c index de58c2a..ed41a6a 100644 --- a/src/sp_config.c +++ b/src/sp_config.c | |||
| @@ -11,7 +11,7 @@ static zend_result sp_process_config_root(sp_parsed_keyword *parsed_rule) { | |||
| 11 | {parse_unserialize_noclass, SP_TOKEN_UNSERIALIZE_NOCLASS, &(SPCFG(unserialize_noclass))}, | 11 | {parse_unserialize_noclass, SP_TOKEN_UNSERIALIZE_NOCLASS, &(SPCFG(unserialize_noclass))}, |
| 12 | {parse_enable, SP_TOKEN_HARDEN_RANDOM, &(SPCFG(random).enable)}, | 12 | {parse_enable, SP_TOKEN_HARDEN_RANDOM, &(SPCFG(random).enable)}, |
| 13 | {parse_log_media, SP_TOKEN_LOG_MEDIA, &(SPCFG(log_media))}, | 13 | {parse_log_media, SP_TOKEN_LOG_MEDIA, &(SPCFG(log_media))}, |
| 14 | {parse_ulong, SP_TOKEN_LOG_MAX_LEN, &(SPCFG(log_max_len))}, | 14 | {parse_uint, SP_TOKEN_LOG_MAX_LEN, &(SPCFG(log_max_len))}, |
| 15 | {parse_disabled_functions, SP_TOKEN_DISABLE_FUNC, NULL}, | 15 | {parse_disabled_functions, SP_TOKEN_DISABLE_FUNC, NULL}, |
| 16 | {parse_readonly_exec, SP_TOKEN_READONLY_EXEC, &(SPCFG(readonly_exec))}, | 16 | {parse_readonly_exec, SP_TOKEN_READONLY_EXEC, &(SPCFG(readonly_exec))}, |
| 17 | {parse_enable, SP_TOKEN_GLOBAL_STRICT, &(SPCFG(global_strict).enable)}, | 17 | {parse_enable, SP_TOKEN_GLOBAL_STRICT, &(SPCFG(global_strict).enable)}, |
| @@ -198,13 +198,13 @@ SP_PARSEKW_FN(parse_int) { | |||
| 198 | return ret; | 198 | return ret; |
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | SP_PARSEKW_FN(parse_ulong) { | 201 | SP_PARSEKW_FN(parse_uint) { |
| 202 | int ret = SP_PARSER_SUCCESS; | 202 | int ret = SP_PARSER_SUCCESS; |
| 203 | SP_PARSE_ARG(value); | 203 | SP_PARSE_ARG(value); |
| 204 | 204 | ||
| 205 | char *endptr; | 205 | char *endptr; |
| 206 | errno = 0; | 206 | errno = 0; |
| 207 | *(u_long*)retval = (u_long)strtoul(ZSTR_VAL(value), &endptr, 10); | 207 | *(u_int*)retval = (u_int)strtoul(ZSTR_VAL(value), &endptr, 10); |
| 208 | if (errno != 0 || !endptr || endptr == ZSTR_VAL(value)) { | 208 | if (errno != 0 || !endptr || endptr == ZSTR_VAL(value)) { |
| 209 | sp_log_err("config", "Failed to parse arg '%s' of `%s` on line %zu", ZSTR_VAL(value), token, kw->lineno); | 209 | sp_log_err("config", "Failed to parse arg '%s' of `%s` on line %zu", ZSTR_VAL(value), token, kw->lineno); |
| 210 | ret = SP_PARSER_ERROR; | 210 | ret = SP_PARSER_ERROR; |
diff --git a/src/sp_config.h b/src/sp_config.h index af227ba..407c9bd 100644 --- a/src/sp_config.h +++ b/src/sp_config.h | |||
| @@ -297,7 +297,7 @@ SP_PARSEKW_FN(parse_str); | |||
| 297 | SP_PARSEKW_FN(parse_regexp); | 297 | SP_PARSEKW_FN(parse_regexp); |
| 298 | SP_PARSEKW_FN(parse_empty); | 298 | SP_PARSEKW_FN(parse_empty); |
| 299 | SP_PARSEKW_FN(parse_int); | 299 | SP_PARSEKW_FN(parse_int); |
| 300 | SP_PARSEKW_FN(parse_ulong); | 300 | SP_PARSEKW_FN(parse_uint); |
| 301 | SP_PARSEKW_FN(parse_php_type); | 301 | SP_PARSEKW_FN(parse_php_type); |
| 302 | SP_PARSEKW_FN(parse_cidr); | 302 | SP_PARSEKW_FN(parse_cidr); |
| 303 | SP_PARSEKW_FN(parse_list); | 303 | SP_PARSEKW_FN(parse_list); |
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 0150a1e..ba9ee7c 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -33,8 +33,8 @@ SP_PARSE_FN(parse_session) { | |||
| 33 | {parse_empty, SP_TOKEN_ENCRYPT, &(cfg->encrypt)}, | 33 | {parse_empty, SP_TOKEN_ENCRYPT, &(cfg->encrypt)}, |
| 34 | {parse_empty, SP_TOKEN_SIMULATION, &(cfg->simulation)}, | 34 | {parse_empty, SP_TOKEN_SIMULATION, &(cfg->simulation)}, |
| 35 | {parse_empty, SP_TOKEN_SIM, &(cfg->simulation)}, | 35 | {parse_empty, SP_TOKEN_SIM, &(cfg->simulation)}, |
| 36 | {parse_ulong, SP_TOKEN_SID_MIN_LENGTH, &(cfg->sid_min_length)}, | 36 | {parse_uint, SP_TOKEN_SID_MIN_LENGTH, &(cfg->sid_min_length)}, |
| 37 | {parse_ulong, SP_TOKEN_SID_MAX_LENGTH, &(cfg->sid_max_length)}, | 37 | {parse_uint, SP_TOKEN_SID_MAX_LENGTH, &(cfg->sid_max_length)}, |
| 38 | {0, 0, 0}}; | 38 | {0, 0, 0}}; |
| 39 | 39 | ||
| 40 | SP_PROCESS_CONFIG_KEYWORDS_ERR(); | 40 | SP_PROCESS_CONFIG_KEYWORDS_ERR(); |
| @@ -144,8 +144,8 @@ SP_PARSE_FN(parse_global) { | |||
| 144 | {parse_str, SP_TOKEN_ENCRYPTION_KEY, &(SPCFG(encryption_key))}, | 144 | {parse_str, SP_TOKEN_ENCRYPTION_KEY, &(SPCFG(encryption_key))}, |
| 145 | {parse_str, SP_TOKEN_ENV_VAR, &(SPCFG(cookies_env_var))}, | 145 | {parse_str, SP_TOKEN_ENV_VAR, &(SPCFG(cookies_env_var))}, |
| 146 | {parse_log_media, SP_TOKEN_LOG_MEDIA, &(SPCFG(log_media))}, | 146 | {parse_log_media, SP_TOKEN_LOG_MEDIA, &(SPCFG(log_media))}, |
| 147 | {parse_ulong, SP_TOKEN_LOG_MAX_LEN, &(SPCFG(log_max_len))}, | 147 | {parse_uint, SP_TOKEN_LOG_MAX_LEN, &(SPCFG(log_max_len))}, |
| 148 | {parse_ulong, SP_TOKEN_MAX_EXECUTION_DEPTH, &(SPCFG(max_execution_depth))}, | 148 | {parse_uint, SP_TOKEN_MAX_EXECUTION_DEPTH, &(SPCFG(max_execution_depth))}, |
| 149 | {parse_enable, SP_TOKEN_SERVER_ENCODE, &(SPCFG(server_encode))}, | 149 | {parse_enable, SP_TOKEN_SERVER_ENCODE, &(SPCFG(server_encode))}, |
| 150 | {parse_enable, SP_TOKEN_SERVER_STRIP, &(SPCFG(server_strip))}, | 150 | {parse_enable, SP_TOKEN_SERVER_STRIP, &(SPCFG(server_strip))}, |
| 151 | {parse_enable, SP_TOKEN_SHOW_OLD_PHP_WARNING, &(SPCFG(show_old_php_warning))}, | 151 | {parse_enable, SP_TOKEN_SHOW_OLD_PHP_WARNING, &(SPCFG(show_old_php_warning))}, |
| @@ -333,7 +333,7 @@ SP_PARSE_FN(parse_disabled_functions) { | |||
| 333 | {parse_php_type, SP_TOKEN_RET_TYPE, &(df->ret_type)}, | 333 | {parse_php_type, SP_TOKEN_RET_TYPE, &(df->ret_type)}, |
| 334 | {parse_str, SP_TOKEN_LOCAL_VAR, &(var)}, | 334 | {parse_str, SP_TOKEN_LOCAL_VAR, &(var)}, |
| 335 | {parse_int, SP_TOKEN_VALUE_ARG_POS, &(df->pos)}, | 335 | {parse_int, SP_TOKEN_VALUE_ARG_POS, &(df->pos)}, |
| 336 | {parse_ulong, SP_TOKEN_LINE_NUMBER, &(df->line)}, | 336 | {parse_uint, SP_TOKEN_LINE_NUMBER, &(df->line)}, |
| 337 | {0, 0, 0}}; | 337 | {0, 0, 0}}; |
| 338 | 338 | ||
| 339 | SP_PROCESS_CONFIG_KEYWORDS(goto out); | 339 | SP_PROCESS_CONFIG_KEYWORDS(goto out); |
