Skip to content

Commit 8b969a5

Browse files
author
Junio C Hamano
committed
Merge branch 'maint'
* maint: Another memory overrun in http-push.c fetch.o depends on the headers, too. Documentation: Correct minor typo in git-add documentation. Documentation/git-send-email.txt: Fix labeled list formatting Documentation/git-quiltimport.txt: Fix labeled list formatting Documentation/build-docdep.perl: Fix dependencies for included asciidoc files
2 parents 112f638 + eecc836 commit 8b969a5

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

Documentation/build-docdep.perl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@
4141
while (my ($text, $included) = each %include) {
4242
if (! exists $included{$text} &&
4343
(my $base = $text) =~ s/\.txt$//) {
44-
my ($suffix) = '1';
45-
if ($base eq 'git') {
46-
$suffix = '7'; # yuck...
47-
}
48-
print "$base.html $base.$suffix : ", join(" ", keys %$included), "\n";
44+
print "$base.html $base.xml : ", join(" ", keys %$included), "\n";
4945
}
5046
}

Documentation/git-add.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ OPTIONS
5252
-f::
5353
Allow adding otherwise ignored files.
5454

55-
\i, \--interactive::
55+
-i, \--interactive::
5656
Add modified contents in the working tree interactively to
5757
the index.
5858

Documentation/git-quiltimport.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ OPTIONS
4242
--patches <dir>::
4343
The directory to find the quilt patches and the
4444
quilt series file.
45-
46-
The default for the patch directory is patches
47-
or the value of the $QUILT_PATCHES environment
48-
variable.
45+
+
46+
The default for the patch directory is patches
47+
or the value of the $QUILT_PATCHES environment
48+
variable.
4949

5050
Author
5151
------

Documentation/git-send-email.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ The options available are:
2626

2727
--bcc::
2828
Specify a "Bcc:" value for each email.
29-
30-
The --bcc option must be repeated for each user you want on the bcc list.
29+
+
30+
The --bcc option must be repeated for each user you want on the bcc list.
3131

3232
--cc::
3333
Specify a starting "Cc:" value for each email.
34-
35-
The --cc option must be repeated for each user you want on the cc list.
34+
+
35+
The --cc option must be repeated for each user you want on the cc list.
3636

3737
--chain-reply-to, --no-chain-reply-to::
3838
If this is set, each email will be sent as a reply to the previous
@@ -87,8 +87,8 @@ The options available are:
8787
Specify the primary recipient of the emails generated.
8888
Generally, this will be the upstream maintainer of the
8989
project involved.
90-
91-
The --to option must be repeated for each user you want on the to list.
90+
+
91+
The --to option must be repeated for each user you want on the to list.
9292

9393

9494
Author

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
780780
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
781781
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
782782

783-
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
783+
$(LIB_OBJS) $(BUILTIN_OBJS) fetch.o: $(LIB_H)
784784
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
785785
$(DIFF_OBJS): diffcore.h
786786

http-push.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,9 @@ xml_cdata(void *userData, const XML_Char *s, int len)
12711271
struct xml_ctx *ctx = (struct xml_ctx *)userData;
12721272
free(ctx->cdata);
12731273
ctx->cdata = xmalloc(len + 1);
1274-
strlcpy(ctx->cdata, s, len + 1);
1274+
/* NB: 's' is not null-terminated, can not use strlcpy here */
1275+
memcpy(ctx->cdata, s, len);
1276+
ctx->cdata[len] = '\0';
12751277
}
12761278

12771279
static struct remote_lock *lock_remote(const char *path, long timeout)
@@ -1473,7 +1475,8 @@ static void process_ls_object(struct remote_ls_ctx *ls)
14731475
return;
14741476
path += 8;
14751477
obj_hex = xmalloc(strlen(path));
1476-
strlcpy(obj_hex, path, 3);
1478+
/* NB: path is not null-terminated, can not use strlcpy here */
1479+
memcpy(obj_hex, path, 2);
14771480
strcpy(obj_hex + 2, path + 3);
14781481
one_remote_object(obj_hex);
14791482
free(obj_hex);
@@ -2170,7 +2173,8 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
21702173
/* If it's a symref, set the refname; otherwise try for a sha1 */
21712174
if (!prefixcmp((char *)buffer.buffer, "ref: ")) {
21722175
*symref = xmalloc(buffer.posn - 5);
2173-
strlcpy(*symref, (char *)buffer.buffer + 5, buffer.posn - 5);
2176+
memcpy(*symref, (char *)buffer.buffer + 5, buffer.posn - 6);
2177+
(*symref)[buffer.posn - 6] = '\0';
21742178
} else {
21752179
get_sha1_hex(buffer.buffer, sha1);
21762180
}

0 commit comments

Comments
 (0)