Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
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
go
Commits
d3a2925b
Commit
d3a2925b
authored
Jul 06, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catch corruption - avoid crash
R=rsc DELTA=4 (4 added, 0 deleted, 0 changed) OCL=31192 CL=31198
parent
deb95477
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/pkg/gob/decode.go
src/pkg/gob/decode.go
+4
-0
No files found.
src/pkg/gob/decode.go
View file @
d3a2925b
...
@@ -295,6 +295,10 @@ func decodeStruct(engine *decEngine, rtyp reflect.StructType, r io.Reader, p uin
...
@@ -295,6 +295,10 @@ func decodeStruct(engine *decEngine, rtyp reflect.StructType, r io.Reader, p uin
basep
:=
p
;
basep
:=
p
;
for
state
.
err
==
nil
{
for
state
.
err
==
nil
{
delta
:=
int
(
DecodeUint
(
state
));
delta
:=
int
(
DecodeUint
(
state
));
if
delta
<
0
{
state
.
err
=
os
.
ErrorString
(
"gob decode: corrupted data: negative delta"
);
break
}
if
state
.
err
!=
nil
||
delta
==
0
{
// struct terminator is zero delta fieldnum
if
state
.
err
!=
nil
||
delta
==
0
{
// struct terminator is zero delta fieldnum
break
break
}
}
...
...
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