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
19475924
Commit
19475924
authored
Aug 25, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3355 from palmin/palmin/fix-2830
Include the 4 characters not recognised as hex-number in parse_len
parents
6b36945d
2d1d2bb5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
src/transports/smart_pkt.c
+9
-2
No files found.
src/transports/smart_pkt.c
View file @
19475924
...
...
@@ -351,7 +351,7 @@ static int unpack_pkt(git_pkt **out, const char *line, size_t len)
static
int32_t
parse_len
(
const
char
*
line
)
{
char
num
[
PKT_LEN_SIZE
+
1
];
int
i
,
error
;
int
i
,
k
,
error
;
int32_t
len
;
const
char
*
num_end
;
...
...
@@ -360,7 +360,14 @@ static int32_t parse_len(const char *line)
for
(
i
=
0
;
i
<
PKT_LEN_SIZE
;
++
i
)
{
if
(
!
isxdigit
(
num
[
i
]))
{
giterr_set
(
GITERR_NET
,
"Found invalid hex digit in length"
);
/* Make sure there are no special characters before passing to error message */
for
(
k
=
0
;
k
<
PKT_LEN_SIZE
;
++
k
)
{
if
(
!
isprint
(
num
[
k
]))
{
num
[
k
]
=
'.'
;
}
}
giterr_set
(
GITERR_NET
,
"invalid hex digit in length: '%s'"
,
num
);
return
-
1
;
}
}
...
...
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