Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
og-rek
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
og-rek
Commits
c1da7072
Commit
c1da7072
authored
Nov 24, 2013
by
Damian Gryski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: avoid problems with short reads
parent
43c00601
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
ogórek.go
ogórek.go
+6
-4
No files found.
ogórek.go
View file @
c1da7072
...
...
@@ -411,7 +411,10 @@ func (d *Decoder) loadBinString() error {
func
(
d
*
Decoder
)
loadShortBinString
()
error
{
b
,
_
:=
d
.
r
.
ReadByte
()
s
:=
make
([]
byte
,
b
)
d
.
r
.
Read
(
s
)
_
,
err
:=
io
.
ReadFull
(
d
.
r
,
s
)
if
err
!=
nil
{
return
err
}
d
.
push
(
string
(
s
))
return
nil
}
...
...
@@ -586,9 +589,8 @@ func (d *Decoder) loadSetItems() error {
}
func
(
d
*
Decoder
)
binFloat
()
error
{
f
:=
make
([]
byte
,
8
)
d
.
r
.
Read
(
f
)
u
:=
binary
.
BigEndian
.
Uint64
(
f
)
var
u
uint64
binary
.
Read
(
d
.
r
,
binary
.
BigEndian
,
&
u
)
d
.
stack
=
append
(
d
.
stack
,
math
.
Float64frombits
(
u
))
return
nil
}
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