Skip to content

libavb: fix avb_replace() OOM handling

Josh Law u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1libavb: fix avb_replace() OOM handlinglib/libavb/avb_util.c+7 -31 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchSimon Glass
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/1] libavb: fix avb_replace() OOM handling

Hi folks,

Since I am a new contributor, I would like to introduce myself first. I am 15, I am from the UK, and I write C. I am interested in lib/, ARM devices, and Android.

Enough of the introduction. Let's talk about the patch.

avb_replace() is documented to return NULL on OOM. It already did that before any output was built, but if a later allocation failed after the first replacement, it returned the partial buffer instead. The callers only treat NULL as failure, so they could keep booting with truncated AVB bootargs.

This patch frees the partial buffer and returns NULL. The existing callers can then report OOM instead of accepting a shortened result.

Josh Law (1):
libavb: fix avb_replace() OOM handling

 lib/libavb/avb_util.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
2.47.3