Project

General

Profile

Actions

Bug #6057

closed

rust/jsonbuilder: better handling of memory allocation errors

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

Updated by Jason Ish 11 months ago

  • Status changed from New to In Progress
  • Assignee changed from OISF Dev to Jason Ish
Actions #2

Updated by Philippe Antoine 11 months ago

Actions #3

Updated by Jason Ish 10 months ago

  • Status changed from In Progress to Closed
  • Target version changed from TBD to 7.0.0-rc2
Actions

Also available in: Atom PDF