forked from google/oss-fuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[glib] GLib: more targets (google#1695)
* better seed corpus for fuzz_key * new target: fuzz_variant_text * new target: fuzz_dbus_message * get ninja from pip * remove target: fuzz_markup * new target: fuzz_variant_binary
- Loading branch information
Showing
7 changed files
with
101 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "gio/gio.h" | ||
#include <stdint.h> | ||
|
||
static GDBusCapabilityFlags flags = G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING; | ||
|
||
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | ||
gssize bytes = g_dbus_message_bytes_needed((guchar*)data, size, NULL); | ||
if (bytes <= 0 || bytes > (100 << 20)) | ||
return 0; | ||
|
||
g_autoptr(GDBusMessage) msg = | ||
g_dbus_message_new_from_blob((guchar*)data, size, flags, NULL); | ||
if (!msg) | ||
return 0; | ||
|
||
gsize msg_size; | ||
g_autofree guchar* blob = g_dbus_message_to_blob(msg, &msg_size, flags, NULL); | ||
return 0; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "glib/glib.h" | ||
#include <stdint.h> | ||
|
||
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | ||
g_autoptr(GVariant) variant = g_variant_new_from_data( | ||
G_VARIANT_TYPE_VARIANT, data, size, FALSE, NULL, NULL); | ||
if (variant) { | ||
g_variant_get_normal_form(variant); | ||
g_variant_get_data(variant); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "glib/glib.h" | ||
#include <stdint.h> | ||
|
||
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | ||
const gchar* gdata = (const gchar*)data; | ||
g_autoptr(GVariant) variant = | ||
g_variant_parse(NULL, gdata, gdata + size, NULL, NULL); | ||
if (variant) { // g_autofree requires {} | ||
g_autofree gchar* text = g_variant_print(variant, TRUE); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
value="'" | ||
value="(" | ||
value=")" | ||
value="<" | ||
value=">" | ||
value="[" | ||
value="]" | ||
value="{" | ||
value="}" | ||
value="*" | ||
value="?" | ||
value="@" | ||
value="boolean" | ||
value="byte" | ||
value="double" | ||
value="false" | ||
value="handle" | ||
value="int16" | ||
value="int32" | ||
value="int64" | ||
value="just" | ||
value="nothing" | ||
value="objectpath" | ||
value="signature" | ||
value="string" | ||
value="true" | ||
value="uint16" | ||
value="uint32" | ||
value="uint64" |