[PATCH 1/1] fs: fat: avoid NULL dereference when root dir is full

Simon Glass sjg at chromium.org
Sun Nov 22 00:07:50 CET 2020


On Thu, 19 Nov 2020 at 05:42, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> When trying to create a file in the full root directory of a FAT32
> filesystem a NULL dereference can be observed.
>
> When the root directory of a FAT16 filesystem is full fill_dir_slot() must
> return -1 to signal that a new directory entry could not be allocated.
>
> Fixes: cd2d727fff7e ("fs: fat: allocate a new cluster for root directory of fat32")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  fs/fat/fat_write.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list