Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/oss-fuzz/fuzz-url-decode-mem.c # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / oss-fuzz / fuzz-url-decode-mem.c` 43 lines ยท 691 bytes Raw Blame History 1 #include "git-compat-util.h" 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include "url.h" 8 9 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); 10 11 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 12 { 13 char *buf; 14 char *r; 15 const char *pbuf; 16 17 buf = malloc(size + 1); 18 if (!buf) 19 return 0; 20 21 memcpy(buf, data, size); 22 buf[size] = 0; 23 24 // start fuzzing 25 r = url_decode(buf); 26 free(r); 27 28 r = url_percent_decode(buf); 29 free(r); 30 31 pbuf = (const char*) buf; 32 r = url_decode_parameter_name(&pbuf); 33 free(r); 34 35 pbuf = (const char*) buf; 36 r = url_decode_parameter_value(&pbuf); 37 free(r); 38 39 // cleanup 40 free(buf); 41 42 return 0; 43 }