Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
68cce4ab
Commit
68cce4ab
authored
Sep 05, 2010
by
Anthony Martin
Committed by
Rob Pike
Sep 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmt.Scan: fix integer overflow on 32-bit machines
R=r, rsc CC=golang-dev
https://golang.org/cl/2144043
parent
d54b921c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
scan.go
src/pkg/fmt/scan.go
+1
-1
scan_test.go
src/pkg/fmt/scan_test.go
+3
-0
No files found.
src/pkg/fmt/scan.go
View file @
68cce4ab
...
...
@@ -740,7 +740,7 @@ func (s *ss) scanOne(verb int, field interface{}) {
case
*
int32
:
*
v
=
int32
(
s
.
scanInt
(
verb
,
32
))
case
*
int64
:
*
v
=
s
.
scanInt
(
verb
,
intBits
)
*
v
=
s
.
scanInt
(
verb
,
64
)
case
*
uint
:
*
v
=
uint
(
s
.
scanUint
(
verb
,
intBits
))
case
*
uint8
:
...
...
src/pkg/fmt/scan_test.go
View file @
68cce4ab
...
...
@@ -183,6 +183,9 @@ var scanTests = []ScanTest{
// Custom scanner.
ScanTest
{
" vvv "
,
&
xVal
,
Xs
(
"vvv"
)},
// Fixed bugs
ScanTest
{
"2147483648
\n
"
,
&
int64Val
,
int64
(
2147483648
)},
// was: integer overflow
}
var
scanfTests
=
[]
ScanfTest
{
...
...
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