Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mf
go-multiaddr
Commits
6ee313e6
Commit
6ee313e6
authored
Sep 11, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not accept invalid-start multiaddrs
parent
99196c0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
codec.go
codec.go
+4
-0
No files found.
codec.go
View file @
6ee313e6
...
...
@@ -12,6 +12,10 @@ func StringToBytes(s string) ([]byte, error) {
b
:=
[]
byte
{}
sp
:=
strings
.
Split
(
s
,
"/"
)
if
sp
[
0
]
!=
""
{
return
nil
,
fmt
.
Errorf
(
"invalid multiaddr, must begin with /"
)
}
// consume first empty elem
sp
=
sp
[
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