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_network_io.h" |
17 | | |
18 | 411 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
19 | 411 | apr_pool_t *pool; |
20 | 411 | apr_pool_initialize(); |
21 | 411 | if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { |
22 | 0 | abort(); |
23 | 0 | } |
24 | | |
25 | 411 | char *addr = NULL; |
26 | 411 | char *scope_id = NULL; |
27 | 411 | apr_port_t port = 0; |
28 | 411 | char *input_string = strndup((const char *)data, size); |
29 | | |
30 | 411 | apr_parse_addr_port(&addr, &scope_id, &port, input_string, pool); |
31 | | |
32 | 411 | free(input_string); |
33 | 411 | apr_pool_destroy(pool); |
34 | 411 | apr_pool_terminate(); |
35 | | |
36 | 411 | return 0; |
37 | 411 | } |