libavb: fix avb_replace() OOM handling
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest1 patch 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | libavb: fix avb_replace() OOM handlinglib/ | +7 | 1 reply |
Reviews trailers per patch
The patch has a Reviewed-by or Acked-by.
| Patch | Simon Glass |
|---|---|
| 1/1 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
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