Return 1 if the specified string contains spaces or null characters. * We do this for usernames and key patterns for simpler rewriting of * ACL rules, presentation on ACL list, and to avoid subtle security bugs * that may arise from parsing the rules in presence of escapes. * The function returns 0 if the string has no spaces. */
| 206 | * that may arise from parsing the rules in presence of escapes. |
| 207 | * The function returns 0 if the string has no spaces. */ |
| 208 | int ACLStringHasSpaces(const char *s, size_t len) { |
| 209 | for (size_t i = 0; i < len; i++) { |
| 210 | if (isspace(s[i]) || s[i] == 0) return 1; |
| 211 | } |
| 212 | return 0; |
| 213 | } |
| 214 | |
| 215 | /* Given the category name the command returns the corresponding flag, or |
| 216 | * zero if there is no match. */ |
no outgoing calls
no test coverage detected