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 "../parser/sdp/sdp.h" 13 14 #include "../cachedb/test/test_cachedb.h" 15 #include "../lib/test/test_csv.h" 16 #include "../mem/test/test_malloc.h" 17 #include "../str.h" 18 19 #include "../context.h" 20 #include "../dprint.h" 21 #include "../globals.h" 22 #include "../lib/list.h" 23 #include "../sr_module.h" 24 #include "../sr_module_deps.h" 25 LLVMFuzzerTestOneInput(const char * data,size_t size)26int LLVMFuzzerTestOneInput(const char *data, size_t size) { 27 ensure_global_context(); 28 struct sip_uri u; 29 30 if (size <= 1) { 31 return 0; 32 } 33 34 struct sip_msg orig_inv = {}; 35 orig_inv.buf = (char *)data; 36 orig_inv.len = size; 37 38 parse_msg(orig_inv.buf, orig_inv.len, &orig_inv); 39 free_sip_msg(&orig_inv); 40 return 0; 41 } 42