File: 0001-Fix-int-overflow-on-32-bits-systems-59.patch

package info (click to toggle)
golang-github-google-gofuzz 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 176 kB
  • sloc: makefile: 2
file content (49 lines) | stat: -rw-r--r-- 1,416 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From: =?utf-8?q?Robert-Andr=C3=A9_Mauchin?=
 <30413512+eclipseo@users.noreply.github.com>
Date: Tue, 5 Jan 2021 18:40:07 -0500
Subject: Fix int overflow on 32 bits systems (#59)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Fix #58

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
---
 bytesource/bytesource_test.go | 4 ++--
 fuzz_test.go                  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bytesource/bytesource_test.go b/bytesource/bytesource_test.go
index 609cf5e..e1a8f54 100644
--- a/bytesource/bytesource_test.go
+++ b/bytesource/bytesource_test.go
@@ -91,9 +91,9 @@ func TestByteSourceValues(t *testing.T) {
 
 	r := rand.New(New(data))
 
-	got := []int{r.Int(), r.Int(), r.Int(), r.Int(), r.Int()}
+	got := []int64{r.Int63(), r.Int63(), r.Int63(), r.Int63(), r.Int63()}
 
-	want := []int{
+	want := []int64{
 		3568552425102051206,
 		3568552489526560135,
 		3568569467532292485,
diff --git a/fuzz_test.go b/fuzz_test.go
index 0a3b771..4bbffe4 100644
--- a/fuzz_test.go
+++ b/fuzz_test.go
@@ -635,10 +635,10 @@ func TestNewFromGoFuzz(t *testing.T) {
 
 	input := []byte{1, 2, 3}
 
-	var got int
+	var got int64
 	NewFromGoFuzz(input).Fuzz(&got)
 
-	if want := 5563767293437588600; want != got {
+	if want := int64(5563767293437588600); want != got {
 		t.Errorf("Fuzz(%q) = %d, want: %d", input, got, want)
 	}
 }