Re: [PATCH 1/2] diskfilter: check calloc() result for NULL

2022-10-06 Thread Daniel Kiper
On Sun, Aug 21, 2022 at 10:22:35PM +1000, Daniel Axtens wrote: > With wildly corrupt inputs, we can end up trying to calloc a very > large amount of memory, which will fail and give us a NULL pointer. > We need to check that to avoid a crash. (And, even if we blocked > such inputs, it is good

[PATCH 1/2] diskfilter: check calloc() result for NULL

2022-08-21 Thread Daniel Axtens
With wildly corrupt inputs, we can end up trying to calloc a very large amount of memory, which will fail and give us a NULL pointer. We need to check that to avoid a crash. (And, even if we blocked such inputs, it is good practice to check the results of allocations anyway.) Signed-off-by: