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-parse-attr-line.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-parse-attr-line.c` 41 lines ยท 732 bytes Raw Blame History 1 #define DISABLE_SIGN_COMPARE_WARNINGS 2 3 #include "git-compat-util.h" 4 #include 5 #include 6 #include 7 #include 8 #include "attr.h" 9 10 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); 11 12 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 13 { 14 struct match_attr *res; 15 char *buf; 16 17 buf = malloc(size + 1); 18 if (!buf) 19 return 0; 20 21 memcpy(buf, data, size); 22 buf[size] = 0; 23 24 res = parse_attr_line(buf, "dummy", 0, 0); 25 26 if (res) { 27 size_t j; 28 for (j = 0; j < res->num_attr; j++) { 29 const char *setto = res->state[j].setto; 30 if (ATTR_TRUE(setto) || ATTR_FALSE(setto) || 31 ATTR_UNSET(setto)) 32 ; 33 else 34 free((char *)setto); 35 } 36 free(res); 37 } 38 free(buf); 39 40 return 0; 41 }