From c050d42e1a7d7b02b2205c116e8c98fc49aab6a9 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Thu, 1 Aug 2024 19:07:32 +0200 Subject: crypto/rand: crash program if Read would return an error Fixes #66821 Fixes #54980 Change-Id: Ib081f4e4f75c7936fc3f5b31d3bd07cca1c2a55c Reviewed-on: https://go-review.googlesource.com/c/go/+/602497 Reviewed-by: Michael Pratt Reviewed-by: Roland Shoemaker LUCI-TryBot-Result: Go LUCI Reviewed-by: Daniel McCarney --- src/runtime/panic.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/runtime/panic.go') diff --git a/src/runtime/panic.go b/src/runtime/panic.go index d70d567912..a10d1dc959 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -1033,6 +1033,11 @@ func sync_fatal(s string) { fatal(s) } +//go:linkname rand_fatal crypto/rand.fatal +func rand_fatal(s string) { + fatal(s) +} + // throw triggers a fatal error that dumps a stack trace and exits. // // throw should be used for runtime-internal fatal errors where Go itself, -- cgit v1.3-5-g9baa