Skip to content
Snippets Groups Projects
Commit 0405de26 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

test: vlc-demux-libfuzzer: read target from cmdline name

Work-arround oss-fuzz that can't accept scripts like the following:

```
export VLC_TARGET=$target
exec ./vlc-demux-dec-libfuzzer "\$@"
```

Therefore, append the target to the binary name.

cf. https://github.com/google/oss-fuzz/issues/1462#issuecomment-393362400
parent cea2602e
No related branches found
No related tags found
1 merge request!6879test: vlc-demux-libfuzzer: read target from cmdline name
Pipeline #566773 passed with stage
in 11 minutes and 40 seconds
......@@ -41,9 +41,18 @@ static libvlc_instance_t *vlc;
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
(void) argc; (void) argv;
(void) argc;
vlc_run_args_init(&args);
if (args.name == NULL)
{
char *name = *argv[0];
static const char suffix[] = "-libfuzzer";
static const size_t suffix_len = sizeof(suffix) - 1;
char *target_start = strstr(name, suffix);
if (target_start != NULL && target_start[suffix_len] == '-')
args.name = &target_start[suffix_len + 1];
}
vlc = libvlc_create(&args);
return vlc ? 0 : -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment