* Internal helper function to translate a human-readable failpoint string * into a internally-parsable fail_point structure. */
| 972 | * into a internally-parsable fail_point structure. |
| 973 | */ |
| 974 | static char * |
| 975 | parse_fail_point(struct fail_point_setting *ents, char *p) |
| 976 | { |
| 977 | /* <fail_point> :: |
| 978 | * <term> ( "->" <term> )* |
| 979 | */ |
| 980 | uint8_t term_count; |
| 981 | |
| 982 | term_count = 1; |
| 983 | |
| 984 | p = parse_term(ents, p); |
| 985 | if (p == NULL) |
| 986 | return (NULL); |
| 987 | |
| 988 | while (*p != '\0') { |
| 989 | term_count++; |
| 990 | if (p[0] != '-' || p[1] != '>' || |
| 991 | (p = parse_term(ents, p+2)) == NULL || |
| 992 | term_count > FP_MAX_ENTRY_COUNT) |
| 993 | return (NULL); |
| 994 | } |
| 995 | return (p); |
| 996 | } |
| 997 | |
| 998 | /** |
| 999 | * Internal helper function to parse an individual term from a failpoint. |
no test coverage detected