| 1 |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 3 |
/* |
| 4 |
* Copyright (C) 2022 Google, Inc. |
| 5 |
*/ |
| 6 |
|
| 7 |
#include <config.h> |
| 8 |
#include <string.h> |
| 9 |
#include <stdint.h> |
| 10 |
#include <glib.h> |
| 11 |
|
| 12 |
#include "qmi-message.h" |
| 13 |
|
| 14 |
int |
| 15 |
LLVMFuzzerTestOneInput (const uint8_t *data, |
| 16 |
size_t size) |
| 17 |
{ |
| 18 |
g_autoptr(GByteArray) bytearray = NULL; |
| 19 |
g_autoptr(QmiMessage) message = NULL; |
| 20 |
g_autoptr(GError) error = NULL; |
| 21 |
|
| 22 |
if (!size) |
| 23 |
return 0; |
| 24 |
|
| 25 |
bytearray = g_byte_array_append (g_byte_array_sized_new (size), data, size); |
| 26 |
message = qmi_message_new_from_raw (bytearray, &error); |
| 27 |
return 0; |
| 28 |
} |