Project

General

Profile

Actions

Bug #6057

closed

rust/jsonbuilder: better handling of memory allocation errors

Added by Jason Ish over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

As JsonBuilder is in Rust, memory allocation errors will lead to a panic/abort.

Rust 1.57.0 and newer have `try_reserve` for most allocated data structures https://doc.rust-lang.org/std/string/struct.String.html#method.try_reserve which JsonBuilder could use when adding new data. This will let us reason about growing the data like we do in C, and probably better than just wrapping entry points in catch_unwind.


Related issues 1 (1 open0 closed)

Related to Suricata - Security #5851: rust: handle allocation failuresNewOISF DevActions
Actions

Also available in: Atom PDF