Line | Count | Source (jump to first uncovered line) |
1 | | /* Copyright 2021 Google LLC |
2 | | Licensed under the Apache License, Version 2.0 (the "License"); |
3 | | you may not use this file except in compliance with the License. |
4 | | You may obtain a copy of the License at |
5 | | http://www.apache.org/licenses/LICENSE-2.0 |
6 | | Unless required by applicable law or agreed to in writing, software |
7 | | distributed under the License is distributed on an "AS IS" BASIS, |
8 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
9 | | See the License for the specific language governing permissions and |
10 | | limitations under the License. |
11 | | */ |
12 | | #include <stddef.h> |
13 | | #include <stdint.h> |
14 | | #include <stdlib.h> |
15 | | |
16 | | #include "apr_strings.h" |
17 | | |
18 | 287 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
19 | 287 | apr_pool_t *pool; |
20 | 287 | apr_pool_initialize(); |
21 | 287 | if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { |
22 | 0 | abort(); |
23 | 0 | } |
24 | | |
25 | 287 | char *arg_str = strndup((const char *)data, size); |
26 | 287 | char **argv_out; |
27 | 287 | apr_tokenize_to_argv(arg_str, &argv_out, pool); |
28 | | |
29 | 287 | free(arg_str); |
30 | 287 | apr_pool_destroy(pool); |
31 | 287 | apr_pool_terminate(); |
32 | | |
33 | 287 | return 0; |
34 | 287 | } |