| 83 | } |
| 84 | |
| 85 | static bool gi_parse_storage(gi_parse_t *parse) { |
| 86 | size_t count = parse->count; |
| 87 | if (count > (SIZE_MAX - sizeof(cbm_ignore_program_t)) / sizeof(gi_pattern_t)) { |
| 88 | return gi_fail(parse->guard, CBM_IGNORE_CHECKED_LIMIT, CBM_IGNORE_CAP_ARENA); |
| 89 | } |
| 90 | size_t bytes = sizeof(cbm_ignore_program_t) + count * sizeof(gi_pattern_t); |
| 91 | parse->program = gi_allocate(parse->guard, bytes, parse->fault == GI_FAULT_PROGRAM); |
| 92 | if (!parse->program || !gi_zero(parse->guard, parse->program, bytes)) { |
| 93 | return false; |
| 94 | } |
| 95 | parse->program->owner = parse->guard->owner; |
| 96 | parse->program->count = count; |
| 97 | parse->count = 0; |
| 98 | return true; |
| 99 | } |
| 100 | |
| 101 | static cbm_ignore_checked_status_t gi_parse(cbm_ignore_checked_t *owner, const void *bytes, |
| 102 | size_t length, |
no test coverage detected