diff options
Diffstat (limited to 'ifilter.c')
| -rw-r--r-- | ifilter.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -41,7 +41,7 @@ static size_t strnlen(const char *s, size_t maxlen) { | |||
| 41 | } | 41 | } |
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | static size_t strnspn(const char *input, size_t n, const char *accept) | 44 | size_t suhosin_strnspn(const char *input, size_t n, const char *accept) |
| 45 | { | 45 | { |
| 46 | size_t count = 0; | 46 | size_t count = 0; |
| 47 | for (; *input != '\0' && count < n; input++, count++) { | 47 | for (; *input != '\0' && count < n; input++, count++) { |
| @@ -51,7 +51,7 @@ static size_t strnspn(const char *input, size_t n, const char *accept) | |||
| 51 | return count; | 51 | return count; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | static size_t strncspn(const char *input, size_t n, const char *reject) | 54 | size_t suhosin_strncspn(const char *input, size_t n, const char *reject) |
| 55 | { | 55 | { |
| 56 | size_t count = 0; | 56 | size_t count = 0; |
| 57 | for (; *input != '\0' && count < n; input++, count++) { | 57 | for (; *input != '\0' && count < n; input++, count++) { |
| @@ -581,14 +581,14 @@ unsigned int suhosin_input_filter(int arg, char *var, char **val, unsigned int v | |||
| 581 | 581 | ||
| 582 | /* index whitelist/blacklist */ | 582 | /* index whitelist/blacklist */ |
| 583 | if (SUHOSIN_G(array_index_whitelist) && *(SUHOSIN_G(array_index_whitelist))) { | 583 | if (SUHOSIN_G(array_index_whitelist) && *(SUHOSIN_G(array_index_whitelist))) { |
| 584 | if (strnspn(index, index_length, SUHOSIN_G(array_index_whitelist)) != index_length) { | 584 | if (suhosin_strnspn(index, index_length, SUHOSIN_G(array_index_whitelist)) != index_length) { |
| 585 | suhosin_log(S_VARS, "array index contains not whitelisted characters - dropped variable '%s'", var); | 585 | suhosin_log(S_VARS, "array index contains not whitelisted characters - dropped variable '%s'", var); |
| 586 | if (!SUHOSIN_G(simulation)) { | 586 | if (!SUHOSIN_G(simulation)) { |
| 587 | return 0; | 587 | return 0; |
| 588 | } | 588 | } |
| 589 | } | 589 | } |
| 590 | } else if (SUHOSIN_G(array_index_blacklist) && *(SUHOSIN_G(array_index_blacklist))) { | 590 | } else if (SUHOSIN_G(array_index_blacklist) && *(SUHOSIN_G(array_index_blacklist))) { |
| 591 | if (strncspn(index, index_length, SUHOSIN_G(array_index_blacklist)) != index_length) { | 591 | if (suhosin_strncspn(index, index_length, SUHOSIN_G(array_index_blacklist)) != index_length) { |
| 592 | suhosin_log(S_VARS, "array index contains blacklisted characters - dropped variable '%s'", var); | 592 | suhosin_log(S_VARS, "array index contains blacklisted characters - dropped variable '%s'", var); |
| 593 | if (!SUHOSIN_G(simulation)) { | 593 | if (!SUHOSIN_G(simulation)) { |
| 594 | return 0; | 594 | return 0; |
