/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 | 136 | { |
17 | 136 | uint8_t *data = (uint8_t *) Data; |
18 | 136 | size_t outlen = 0; |
19 | 136 | struct simpletlv_member *tlv = NULL; |
20 | | |
21 | 136 | tlv = simpletlv_parse(data, Size, &outlen); |
22 | 136 | simpletlv_free(tlv, outlen); |
23 | | |
24 | 136 | return 0; |
25 | 136 | } |
26 | | |
27 | | /* vim: set ts=4 sw=4 tw=0 noet expandtab: */ |