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
13640d1b
Commit
13640d1b
authored
Mar 25, 2013
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oid: Do not parse OIDs longer than 40
parent
1f107478
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
src/oid.c
+1
-1
tests-clar/core/oid.c
+1
-3
No files found.
src/oid.c
View file @
13640d1b
...
...
@@ -25,7 +25,7 @@ int git_oid_fromstrn(git_oid *out, const char *str, size_t length)
int
v
;
if
(
length
>
GIT_OID_HEXSZ
)
length
=
GIT_OID_HEXSZ
;
return
oid_error_invalid
(
"too long"
)
;
for
(
p
=
0
;
p
<
length
-
1
;
p
+=
2
)
{
v
=
(
git__fromhex
(
str
[
p
+
0
])
<<
4
)
...
...
tests-clar/core/oid.c
View file @
13640d1b
...
...
@@ -11,7 +11,7 @@ void test_core_oid__initialize(void)
{
cl_git_pass
(
git_oid_fromstr
(
&
id
,
str_oid
));
cl_git_pass
(
git_oid_fromstrp
(
&
idp
,
str_oid_p
));
cl_git_
pass
(
git_oid_fromstrp
(
&
idm
,
str_oid_m
));
cl_git_
fail
(
git_oid_fromstrp
(
&
idm
,
str_oid_m
));
}
void
test_core_oid__streq
(
void
)
...
...
@@ -27,6 +27,4 @@ void test_core_oid__streq(void)
cl_assert
(
git_oid_streq
(
&
idp
,
"deadbeef"
)
==
-
1
);
cl_assert
(
git_oid_streq
(
&
idp
,
"I'm not an oid.... :)"
)
==
-
1
);
cl_assert
(
git_oid_cmp
(
&
id
,
&
idm
)
==
0
);
}
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