1
1
diff --git a/Makefile b/Makefile
2
- index 6bfb62cbe9..2230b40a9f 100644
2
+ index 4e255c81f2..05905e3a2e 100644
3
3
--- a/Makefile
4
4
+++ b/Makefile
5
- @@ -756 ,6 +756,11 @@ FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
5
+ @@ -760 ,6 +760,19 @@ FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
6
6
FUZZ_OBJS += oss-fuzz/fuzz-date.o
7
7
FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
8
8
FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
9
9
+ FUZZ_OBJS += oss-fuzz/fuzz-command.o
10
10
+ FUZZ_OBJS += oss-fuzz/fuzz-cmd-status.o
11
11
+ FUZZ_OBJS += oss-fuzz/fuzz-cmd-version.o
12
12
+ FUZZ_OBJS += oss-fuzz/fuzz-cmd-diff.o
13
+ + FUZZ_OBJS += oss-fuzz/fuzz-credential-from-url-gently.o
14
+ + FUZZ_OBJS += oss-fuzz/fuzz-url-decode-mem.o
15
+ + FUZZ_OBJS += oss-fuzz/fuzz-url-end-with-slash.o
16
+ + FUZZ_OBJS += oss-fuzz/fuzz-parse-attr-line.o
17
+ + FUZZ_OBJS += oss-fuzz/fuzz-cmd-bundle-verify.o
18
+ + FUZZ_OBJS += oss-fuzz/fuzz-cmd-unpack-objects.o
19
+ + FUZZ_OBJS += oss-fuzz/fuzz-cmd-apply-check.o
20
+ + FUZZ_OBJS += oss-fuzz/fuzz-cmd-tag-create.o
13
21
+
14
22
.PHONY: fuzz-objs
15
23
fuzz-objs: $(FUZZ_OBJS)
16
24
17
- @@ -1085 ,6 +1089 ,7 @@ LIB_OBJS += oid-array.o
25
+ @@ -1087 ,6 +1100 ,7 @@ LIB_OBJS += oid-array.o
18
26
LIB_OBJS += oidmap.o
19
27
LIB_OBJS += oidset.o
20
28
LIB_OBJS += oidtree.o
21
29
+ LIB_OBJS += oss-fuzz/fuzz-cmd-base.o
22
30
LIB_OBJS += pack-bitmap-write.o
23
31
LIB_OBJS += pack-bitmap.o
24
32
LIB_OBJS += pack-check.o
33
+ @@ -3862,10 +3876,10 @@ FUZZ_CXXFLAGS ?= $(ALL_CFLAGS)
34
+
35
+ .PHONY: fuzz-all
36
+
37
+ - $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS
38
+ - $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \
39
+ + $(FUZZ_PROGRAMS): all
40
+ + $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) $(BUILTIN_OBJS) \
41
+ -Wl,--allow-multiple-definition \
42
+ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE)
43
+ + $(filter %.o,$^) $(filter %.a,$^) git.o [email protected] $(LIBS) $(LIB_FUZZING_ENGINE)
44
+
45
+ fuzz-all: $(FUZZ_PROGRAMS)
46
+
47
+ diff --git a/attr.c b/attr.c
48
+ index 679e42258c..20e426726a 100644
49
+ --- a/attr.c
50
+ +++ b/attr.c
51
+ @@ -351,7 +351,7 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
52
+ return ep + strspn(ep, blank);
53
+ }
54
+
55
+ - static struct match_attr *parse_attr_line(const char *line, const char *src,
56
+ + struct match_attr *parse_attr_line(const char *line, const char *src,
57
+ int lineno, unsigned flags)
58
+ {
59
+ size_t namelen, num_attr, i;
60
+ diff --git a/builtin/bundle.c b/builtin/bundle.c
61
+ index 3ad11dc5d0..2443906572 100644
62
+ --- a/builtin/bundle.c
63
+ +++ b/builtin/bundle.c
64
+ @@ -123,7 +123,7 @@ static int open_bundle(const char *path, struct bundle_header *header,
65
+ return read_bundle_header(path, header);
66
+ }
67
+
68
+ - static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
69
+ + int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
70
+ struct bundle_header header = BUNDLE_HEADER_INIT;
71
+ int bundle_fd = -1;
72
+ int quiet = 0;
73
+ diff --git a/builtin/tag.c b/builtin/tag.c
74
+ index 37473ac21f..c719ea10e7 100644
75
+ --- a/builtin/tag.c
76
+ +++ b/builtin/tag.c
77
+ @@ -589,8 +589,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
78
+ if (repo_get_oid(the_repository, object_ref, &object))
79
+ die(_("Failed to resolve '%s' as a valid ref."), object_ref);
80
+
81
+ - if (strbuf_check_tag_ref(&ref, tag))
82
+ - die(_("'%s' is not a valid tag name."), tag);
83
+ + if (strbuf_check_tag_ref(&ref, tag)) {
84
+ + //die(_("'%s' is not a valid tag name."), tag);
85
+ + ret = 1;
86
+ + goto cleanup;
87
+ + }
88
+
89
+ if (read_ref(ref.buf, &prev))
90
+ oidclr(&prev);
25
91
diff --git a/diff.c b/diff.c
26
- index 648f6717a5..24e42d0cd1 100644
92
+ index ccfa1fca0d..97f895a122 100644
27
93
--- a/diff.c
28
94
+++ b/diff.c
29
- @@ -3557 ,7 +3557 ,7 @@ static void builtin_diff(const char *name_a,
95
+ @@ -3654 ,7 +3654 ,7 @@ static void builtin_diff(const char *name_a,
30
96
}
31
97
if (fill_mmfile(o->repo, &mf1, one) < 0 ||
32
98
fill_mmfile(o->repo, &mf2, two) < 0)
@@ -35,7 +101,25 @@ index 648f6717a5..24e42d0cd1 100644
35
101
/* Quite common confusing case */
36
102
if (mf1.size == mf2.size &&
37
103
!memcmp(mf1.ptr, mf2.ptr, mf1.size)) {
38
- @@ -4009,7 +4009,7 @@ int diff_populate_filespec(struct repository *r,
104
+ @@ -3837,7 +3837,7 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
105
+
106
+ if (fill_mmfile(o->repo, &mf1, one) < 0 ||
107
+ fill_mmfile(o->repo, &mf2, two) < 0)
108
+ - die("unable to read files to diff");
109
+ + return;//die("unable to read files to diff");
110
+
111
+ memset(&xpp, 0, sizeof(xpp));
112
+ memset(&xecfg, 0, sizeof(xecfg));
113
+ @@ -3900,7 +3900,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
114
+
115
+ if (fill_mmfile(o->repo, &mf1, one) < 0 ||
116
+ fill_mmfile(o->repo, &mf2, two) < 0)
117
+ - die("unable to read files to diff");
118
+ + return;//die("unable to read files to diff");
119
+
120
+ /*
121
+ * All the other codepaths check both sides, but not checking
122
+ @@ -4106,7 +4106,7 @@ int diff_populate_filespec(struct repository *r,
39
123
conv_flags = CONV_EOL_RNDTRP_WARN;
40
124
41
125
if (!DIFF_FILE_VALID(s))
@@ -44,7 +128,7 @@ index 648f6717a5..24e42d0cd1 100644
44
128
if (S_ISDIR(s->mode))
45
129
return -1;
46
130
47
- @@ -4113 ,7 +4113 ,7 @@ int diff_populate_filespec(struct repository *r,
131
+ @@ -4210 ,7 +4210 ,7 @@ int diff_populate_filespec(struct repository *r,
48
132
}
49
133
if (oid_object_info_extended(r, &s->oid, &info,
50
134
OBJECT_INFO_LOOKUP_REPLACE))
@@ -53,7 +137,7 @@ index 648f6717a5..24e42d0cd1 100644
53
137
54
138
object_read:
55
139
if (size_only || check_binary) {
56
- @@ -4128 ,7 +4128 ,7 @@ int diff_populate_filespec(struct repository *r,
140
+ @@ -4225 ,7 +4225 ,7 @@ int diff_populate_filespec(struct repository *r,
57
141
info.contentp = &s->data;
58
142
if (oid_object_info_extended(r, &s->oid, &info,
59
143
OBJECT_INFO_LOOKUP_REPLACE))
@@ -62,7 +146,7 @@ index 648f6717a5..24e42d0cd1 100644
62
146
}
63
147
s->should_free = 1;
64
148
}
65
- @@ -7051 ,7 +7051 ,7 @@ size_t fill_textconv(struct repository *r,
149
+ @@ -7226 ,7 +7226 ,7 @@ size_t fill_textconv(struct repository *r,
66
150
return 0;
67
151
}
68
152
if (diff_populate_filespec(r, df, NULL))
@@ -71,7 +155,7 @@ index 648f6717a5..24e42d0cd1 100644
71
155
*outbuf = df->data;
72
156
return df->size;
73
157
}
74
- @@ -7069 ,7 +7069 ,7 @@ size_t fill_textconv(struct repository *r,
158
+ @@ -7244 ,7 +7244 ,7 @@ size_t fill_textconv(struct repository *r,
75
159
76
160
*outbuf = run_textconv(r, driver->textconv, df, &size);
77
161
if (!*outbuf)
@@ -81,10 +165,10 @@ index 648f6717a5..24e42d0cd1 100644
81
165
if (driver->textconv_cache && df->oid_valid) {
82
166
/* ignore errors, as we might be in a readonly repository */
83
167
diff --git a/environment.c b/environment.c
84
- index 18d042b467..7e0ba9dc47 100644
168
+ index 90632a39bc..29e7c0479f 100644
85
169
--- a/environment.c
86
170
+++ b/environment.c
87
- @@ -265 ,7 +265 ,7 @@ void set_git_work_tree(const char *new_work_tree)
171
+ @@ -271 ,7 +271 ,7 @@ void set_git_work_tree(const char *new_work_tree)
88
172
strbuf_release(&realpath);
89
173
return;
90
174
}
0 commit comments