interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / oss-fuzz / fuzz-credential-from-url-gently.c

32 lines · 549 bytes Raw Blame History
1#include "git-compat-util.h"
2#include <stddef.h>
3#include <stdlib.h>
4#include <stdint.h>
5#include <string.h>
6#include <stdio.h>
7#include "credential.h"
8
9int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
10
11int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
12{
13 struct credential c;
14 char *buf;
15
16 buf = malloc(size + 1);
17 if (!buf)
18 return 0;
19
20 memcpy(buf, data, size);
21 buf[size] = 0;
22
23 // start fuzzing
24 credential_init(&c);
25 credential_from_url_gently(&c, buf, 1);
26
27 // cleanup
28 credential_clear(&c);
29 free(buf);
30
31 return 0;
32}