Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
bce94848
Commit
bce94848
authored
Jun 27, 2014
by
Philip Kelley
Committed by
Carlos Martín Nieto
Jan 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix assert when receiving uncommon sideband packet
parent
cbd930f3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
src/indexer.c
+5
-0
src/transports/smart_protocol.c
+2
-0
No files found.
src/indexer.c
View file @
bce94848
...
@@ -433,6 +433,8 @@ static int write_at(git_indexer *idx, const void *data, git_off_t offset, size_t
...
@@ -433,6 +433,8 @@ static int write_at(git_indexer *idx, const void *data, git_off_t offset, size_t
git_map
map
;
git_map
map
;
int
error
;
int
error
;
assert
(
data
&&
size
);
/* the offset needs to be at the beginning of the a page boundary */
/* the offset needs to be at the beginning of the a page boundary */
page_start
=
(
offset
/
page_size
)
*
page_size
;
page_start
=
(
offset
/
page_size
)
*
page_size
;
page_offset
=
offset
-
page_start
;
page_offset
=
offset
-
page_start
;
...
@@ -451,6 +453,9 @@ static int append_to_pack(git_indexer *idx, const void *data, size_t size)
...
@@ -451,6 +453,9 @@ static int append_to_pack(git_indexer *idx, const void *data, size_t size)
{
{
git_off_t
current_size
=
idx
->
pack
->
mwf
.
size
;
git_off_t
current_size
=
idx
->
pack
->
mwf
.
size
;
if
(
!
size
)
return
0
;
/* add the extra space we need at the end */
/* add the extra space we need at the end */
if
(
p_ftruncate
(
idx
->
pack
->
mwf
.
fd
,
current_size
+
size
)
<
0
)
{
if
(
p_ftruncate
(
idx
->
pack
->
mwf
.
fd
,
current_size
+
size
)
<
0
)
{
giterr_set
(
GITERR_OS
,
"Failed to increase size of pack file '%s'"
,
idx
->
pack
->
pack_name
);
giterr_set
(
GITERR_OS
,
"Failed to increase size of pack file '%s'"
,
idx
->
pack
->
pack_name
);
...
...
src/transports/smart_protocol.c
View file @
bce94848
...
@@ -592,6 +592,8 @@ int git_smart__download_pack(
...
@@ -592,6 +592,8 @@ int git_smart__download_pack(
}
}
}
else
if
(
pkt
->
type
==
GIT_PKT_DATA
)
{
}
else
if
(
pkt
->
type
==
GIT_PKT_DATA
)
{
git_pkt_data
*
p
=
(
git_pkt_data
*
)
pkt
;
git_pkt_data
*
p
=
(
git_pkt_data
*
)
pkt
;
if
(
p
->
len
)
error
=
writepack
->
append
(
writepack
,
p
->
data
,
p
->
len
,
stats
);
error
=
writepack
->
append
(
writepack
,
p
->
data
,
p
->
len
,
stats
);
}
else
if
(
pkt
->
type
==
GIT_PKT_FLUSH
)
{
}
else
if
(
pkt
->
type
==
GIT_PKT_FLUSH
)
{
/* A flush indicates the end of the packfile */
/* A flush indicates the end of the packfile */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment