| 1211 | } |
| 1212 | |
| 1213 | static int text_matches_candidate(const char *data, size_t data_len, const char *candidate, |
| 1214 | bool *matches) { |
| 1215 | size_t candidate_len = 0U; |
| 1216 | if (!matches || text_bounded_strlen(candidate, TEXT_MAX_BYTES, &candidate_len) != TEXT_OK || |
| 1217 | text_validate_bytes(candidate, candidate_len, 1) != TEXT_OK) { |
| 1218 | return TEXT_ERROR; |
| 1219 | } |
| 1220 | *matches = |
| 1221 | data_len == candidate_len && (data_len == 0U || memcmp(data, candidate, data_len) == 0); |
| 1222 | return TEXT_OK; |
| 1223 | } |
| 1224 | |
| 1225 | /* Read-only classification: WOULD a migrate of this document succeed? |
| 1226 | * Returns TEXT_OK when the path is absent or already byte-identical to the |
no test coverage detected