Skip to content

Commit 90048f9

Browse files
philipturnbullAshe Connor
authored andcommitted
Remove options mask from fuzzing harness (commonmark#129)
The option mask needs to be kept up to date when new options are added, which is error-prone. Just remove the masking logic as `cmark_parser_new` does not validate the options bitmask anyway.
1 parent 7c71bd1 commit 90048f9

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

test/cmark-fuzz.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,6 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
2727
/* The beginning of `data` is treated as fuzzer configuration */
2828
memcpy(&fuzz_config, data, sizeof(fuzz_config));
2929

30-
/* Mask off valid option bits */
31-
fuzz_config.options &= (
32-
CMARK_OPT_SOURCEPOS |
33-
CMARK_OPT_HARDBREAKS |
34-
CMARK_OPT_NOBREAKS |
35-
CMARK_OPT_NORMALIZE |
36-
CMARK_OPT_VALIDATE_UTF8 |
37-
CMARK_OPT_SMART |
38-
/* GFM specific options */
39-
CMARK_OPT_GITHUB_PRE_LANG |
40-
CMARK_OPT_LIBERAL_HTML_TAG |
41-
CMARK_OPT_FOOTNOTES |
42-
CMARK_OPT_STRIKETHROUGH_DOUBLE_TILDE |
43-
CMARK_OPT_TABLE_PREFER_STYLE_ATTRIBUTES |
44-
CMARK_OPT_FULL_INFO_STRING |
45-
CMARK_OPT_UNSAFE
46-
);
47-
4830
/* Remainder of input is the markdown */
4931
const char *markdown = (const char *)(data + sizeof(fuzz_config));
5032
const size_t markdown_size = size - sizeof(fuzz_config);

0 commit comments

Comments
 (0)