Skip to content

Commit

Permalink
Make type string buffer 1MiB to (try to) avoid buffer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
NHDaly committed Nov 26, 2021
1 parent 2b2c3ab commit 2c39875
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gc-heap-snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ size_t record_node_to_gc_snapshot(jl_value_t *a) JL_NOTSAFEPOINT {
: (size_t)jl_datatype_size(type);

// print full type
// TODO: We _definitely_ have types longer than 1024 bytes....
// TODO(PR): Is it possible to use a variable size string here, instead??
ios_t str_;
ios_mem(&str_, 1024);
ios_mem(&str_, 1048576); // 1 MiB
JL_STREAM* str = (JL_STREAM*)&str_;

jl_static_show(str, (jl_value_t*)type);
Expand Down

0 comments on commit 2c39875

Please sign in to comment.