Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:20
erlang
1440-Protect-binary_to_term-1-against-bad-binar...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1440-Protect-binary_to_term-1-against-bad-binaries-on-32-.patch of Package erlang
From 2859601cca7a9c1c156e64b8e538849e22c38125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Fri, 3 Sep 2021 10:38:39 +0200 Subject: [PATCH] Protect binary_to_term/1 against bad binaries on 32-bit systems --- erts/emulator/beam/external.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c index c8d0bf7f40..776d42d6d2 100644 --- a/erts/emulator/beam/external.c +++ b/erts/emulator/beam/external.c @@ -5783,6 +5783,12 @@ init_done: if (n <= MAP_SMALL_MAP_LIMIT) { heap_size += 3 + n + 1 + n; } else { +#if !defined(ARCH_64) + if ((n >> 30) != 0) { + /* Can't possibly fit in memory. */ + goto error; + } +#endif CHKSIZE(2*n); /* Conservative size check */ heap_size += HASHMAP_ESTIMATED_HEAP_SIZE(n); } -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor