Project

General

Profile

Actions

Bug #6057

closed

rust/jsonbuilder: better handling of memory allocation errors

Added by Jason Ish 12 months ago. Updated 11 months 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