/src/libcacard/fuzz/fuzz_simpletlv.c
Line  | Count  | Source  | 
1  |  | /* Copyright (c) 2020, Red Hat, Inc.  | 
2  |  |  *  | 
3  |  |  * Authors:  Jakub Jelen <jjelen@redhat.com>  | 
4  |  |  *  | 
5  |  |  * This code is licensed under the GNU LGPL, version 2.1 or later.  | 
6  |  |  * See the COPYING file in the top-level directory.  | 
7  |  |  */  | 
8  |  |  | 
9  |  | #include <stdlib.h>  | 
10  |  | #include <libcacard.h>  | 
11  |  | #include <simpletlv.h>  | 
12  |  |  | 
13  |  | #include "fuzzer.h"  | 
14  |  |  | 
15  |  | int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)  | 
16  | 138  | { | 
17  | 138  |     uint8_t *data = (uint8_t *) Data;  | 
18  | 138  |     size_t outlen = 0;  | 
19  | 138  |     struct simpletlv_member *tlv = NULL;  | 
20  |  |  | 
21  | 138  |     tlv = simpletlv_parse(data, Size, &outlen);  | 
22  | 138  |     simpletlv_free(tlv, outlen);  | 
23  |  |  | 
24  | 138  |     return 0;  | 
25  | 138  | }  | 
26  |  |  | 
27  |  | /* vim: set ts=4 sw=4 tw=0 noet expandtab: */  |