summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/git/git-2.5.0/CVE-2016-2315_p4.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/git/git-2.5.0/CVE-2016-2315_p4.patch')
-rw-r--r--meta/recipes-devtools/git/git-2.5.0/CVE-2016-2315_p4.patch237
1 files changed, 237 insertions, 0 deletions
diff --git a/meta/recipes-devtools/git/git-2.5.0/CVE-2016-2315_p4.patch b/meta/recipes-devtools/git/git-2.5.0/CVE-2016-2315_p4.patch
new file mode 100644
index 0000000000..ee2d8cde35
--- /dev/null
+++ b/meta/recipes-devtools/git/git-2.5.0/CVE-2016-2315_p4.patch
@@ -0,0 +1,237 @@
1From dc06dc880013d48f2b09c6b4295419382f3b8230 Mon Sep 17 00:00:00 2001
2From: Jeff King <peff@peff.net>
3Date: Thu, 11 Feb 2016 17:26:44 -0500
4Subject: [PATCH] list-objects: drop name_path entirely
5
6In the previous commit, we left name_path as a thin wrapper
7around a strbuf. This patch drops it entirely. As a result,
8every show_object_fn callback needs to be adjusted. However,
9none of their code needs to be changed at all, because the
10only use was to pass it to path_name(), which now handles
11the bare strbuf.
12
13Signed-off-by: Jeff King <peff@peff.net>
14Signed-off-by: Junio C Hamano <gitster@pobox.com>
15
16Upstream-Status: Backport
17CVE: CVE-2016-2315 patch4
18Signed-off-by: Armin Kuster <akuster@mvista.com>
19
20---
21 builtin/pack-objects.c | 4 ++--
22 builtin/rev-list.c | 4 ++--
23 list-objects.c | 12 +++++-------
24 list-objects.h | 2 +-
25 pack-bitmap-write.c | 2 +-
26 pack-bitmap.c | 4 ++--
27 reachable.c | 2 +-
28 revision.c | 6 +++---
29 revision.h | 8 ++------
30 9 files changed, 19 insertions(+), 25 deletions(-)
31
32Index: git-2.5.0/builtin/pack-objects.c
33===================================================================
34--- git-2.5.0.orig/builtin/pack-objects.c
35+++ git-2.5.0/builtin/pack-objects.c
36@@ -2285,7 +2285,7 @@ static void show_commit(struct commit *c
37 }
38
39 static void show_object(struct object *obj,
40- const struct name_path *path, const char *last,
41+ struct strbuf *path, const char *last,
42 void *data)
43 {
44 char *name = path_name(path, last);
45@@ -2480,7 +2480,7 @@ static int get_object_list_from_bitmap(s
46 }
47
48 static void record_recent_object(struct object *obj,
49- const struct name_path *path,
50+ struct strbuf *path,
51 const char *last,
52 void *data)
53 {
54Index: git-2.5.0/builtin/rev-list.c
55===================================================================
56--- git-2.5.0.orig/builtin/rev-list.c
57+++ git-2.5.0/builtin/rev-list.c
58@@ -178,7 +178,7 @@ static void finish_commit(struct commit
59 }
60
61 static void finish_object(struct object *obj,
62- const struct name_path *path, const char *name,
63+ struct strbuf *path, const char *name,
64 void *cb_data)
65 {
66 struct rev_list_info *info = cb_data;
67@@ -189,7 +189,7 @@ static void finish_object(struct object
68 }
69
70 static void show_object(struct object *obj,
71- const struct name_path *path, const char *component,
72+ struct strbuf *path, const char *component,
73 void *cb_data)
74 {
75 struct rev_list_info *info = cb_data;
76Index: git-2.5.0/list-objects.c
77===================================================================
78--- git-2.5.0.orig/list-objects.c
79+++ git-2.5.0/list-objects.c
80@@ -11,7 +11,7 @@
81 static void process_blob(struct rev_info *revs,
82 struct blob *blob,
83 show_object_fn show,
84- struct name_path *path,
85+ struct strbuf *path,
86 const char *name,
87 void *cb_data)
88 {
89@@ -52,7 +52,7 @@ static void process_blob(struct rev_info
90 static void process_gitlink(struct rev_info *revs,
91 const unsigned char *sha1,
92 show_object_fn show,
93- struct name_path *path,
94+ struct strbuf *path,
95 const char *name,
96 void *cb_data)
97 {
98@@ -69,7 +69,6 @@ static void process_tree(struct rev_info
99 struct object *obj = &tree->object;
100 struct tree_desc desc;
101 struct name_entry entry;
102- struct name_path me;
103 enum interesting match = revs->diffopt.pathspec.nr == 0 ?
104 all_entries_interesting: entry_not_interesting;
105 int baselen = base->len;
106@@ -87,8 +86,7 @@ static void process_tree(struct rev_info
107 }
108
109 obj->flags |= SEEN;
110- me.base = base;
111- show(obj, &me, name, cb_data);
112+ show(obj, base, name, cb_data);
113
114 strbuf_addstr(base, name);
115 if (base->len)
116@@ -113,12 +111,12 @@ static void process_tree(struct rev_info
117 cb_data);
118 else if (S_ISGITLINK(entry.mode))
119 process_gitlink(revs, entry.sha1,
120- show, &me, entry.path,
121+ show, base, entry.path,
122 cb_data);
123 else
124 process_blob(revs,
125 lookup_blob(entry.sha1),
126- show, &me, entry.path,
127+ show, base, entry.path,
128 cb_data);
129 }
130 strbuf_setlen(base, baselen);
131Index: git-2.5.0/list-objects.h
132===================================================================
133--- git-2.5.0.orig/list-objects.h
134+++ git-2.5.0/list-objects.h
135@@ -2,7 +2,7 @@
136 #define LIST_OBJECTS_H
137
138 typedef void (*show_commit_fn)(struct commit *, void *);
139-typedef void (*show_object_fn)(struct object *, const struct name_path *, const char *, void *);
140+typedef void (*show_object_fn)(struct object *, struct strbuf *, const char *, void *);
141 void traverse_commit_list(struct rev_info *, show_commit_fn, show_object_fn, void *);
142
143 typedef void (*show_edge_fn)(struct commit *);
144Index: git-2.5.0/pack-bitmap-write.c
145===================================================================
146--- git-2.5.0.orig/pack-bitmap-write.c
147+++ git-2.5.0/pack-bitmap-write.c
148@@ -148,7 +148,7 @@ static uint32_t find_object_pos(const un
149 return entry->in_pack_pos;
150 }
151
152-static void show_object(struct object *object, const struct name_path *path,
153+static void show_object(struct object *object, struct strbuf *path,
154 const char *last, void *data)
155 {
156 struct bitmap *base = data;
157Index: git-2.5.0/pack-bitmap.c
158===================================================================
159--- git-2.5.0.orig/pack-bitmap.c
160+++ git-2.5.0/pack-bitmap.c
161@@ -422,7 +422,7 @@ static int ext_index_add_object(struct o
162 return bitmap_pos + bitmap_git.pack->num_objects;
163 }
164
165-static void show_object(struct object *object, const struct name_path *path,
166+static void show_object(struct object *object, struct strbuf *path,
167 const char *last, void *data)
168 {
169 struct bitmap *base = data;
170@@ -903,7 +903,7 @@ struct bitmap_test_data {
171 };
172
173 static void test_show_object(struct object *object,
174- const struct name_path *path,
175+ struct strbuf *path,
176 const char *last, void *data)
177 {
178 struct bitmap_test_data *tdata = data;
179Index: git-2.5.0/reachable.c
180===================================================================
181--- git-2.5.0.orig/reachable.c
182+++ git-2.5.0/reachable.c
183@@ -37,7 +37,7 @@ static int add_one_ref(const char *path,
184 * The traversal will have already marked us as SEEN, so we
185 * only need to handle any progress reporting here.
186 */
187-static void mark_object(struct object *obj, const struct name_path *path,
188+static void mark_object(struct object *obj, struct strbuf *path,
189 const char *name, void *data)
190 {
191 update_progress(data);
192Index: git-2.5.0/revision.c
193===================================================================
194--- git-2.5.0.orig/revision.c
195+++ git-2.5.0/revision.c
196@@ -21,17 +21,17 @@
197
198 volatile show_early_output_fn_t show_early_output;
199
200-char *path_name(const struct name_path *path, const char *name)
201+char *path_name(struct strbuf *path, const char *name)
202 {
203 struct strbuf ret = STRBUF_INIT;
204 if (path)
205- strbuf_addbuf(&ret, path->base);
206+ strbuf_addbuf(&ret, path);
207 strbuf_addstr(&ret, name);
208 return strbuf_detach(&ret, NULL);
209 }
210
211 void show_object_with_name(FILE *out, struct object *obj,
212- const struct name_path *path, const char *component)
213+ struct strbuf *path, const char *component)
214 {
215 char *name = path_name(path, component);
216 char *p;
217Index: git-2.5.0/revision.h
218===================================================================
219--- git-2.5.0.orig/revision.h
220+++ git-2.5.0/revision.h
221@@ -256,14 +256,10 @@ extern void put_revision_mark(const stru
222 extern void mark_parents_uninteresting(struct commit *commit);
223 extern void mark_tree_uninteresting(struct tree *tree);
224
225-struct name_path {
226- struct strbuf *base;
227-};
228-
229-char *path_name(const struct name_path *path, const char *name);
230+char *path_name(struct strbuf *path, const char *name);
231
232 extern void show_object_with_name(FILE *, struct object *,
233- const struct name_path *, const char *);
234+ struct strbuf *, const char *);
235
236 extern void add_pending_object(struct rev_info *revs,
237 struct object *obj, const char *name);