Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Protect binary_to_term/1 against bad binaries on 32-bit systems
  • Loading branch information
bjorng committed Sep 7, 2021
2 parents 2ef0ca2 + b67aa7f commit a0c06d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions erts/emulator/beam/external.c
Original file line number Diff line number Diff line change
Expand Up @@ -5571,6 +5571,12 @@ decoded_size(const byte *ep, const byte* endp, int internal_tags, B2TContext* ct
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);
}
Expand Down

0 comments on commit a0c06d9

Please sign in to comment.