[U-Boot] [PATCH] ubifs bad superblock bug

Laurence Withers lwithers at guralp.com
Tue Oct 4 12:14:51 CEST 2011


On Tue, Oct 04, 2011 at 06:41:52PM +0900, Kyungmin Park wrote:
> On Tue, Oct 4, 2011 at 6:08 PM, larsi <larsi at atlantis.wh2.tu-dresden.de> wrote:
> > -       free(ubifs_sb->s_fs_info);
> > -       free(ubifs_sb);
> > +       if (ubifs_sb != null) {

Should be NULL.

> > +               free(ubifs_sb->s_fs_info);
> > +               free(ubifs_sb);
> > +       }
> Which statement is problem? Basically free() check the null address.
> so If ubifs_sb->s_fs_info doesn't have value its skipped. and ubifs_sb
> is similar.

The problem is the first call to free() above. If ubifs_sb is null, then
free(ubis_sb->...) will be a null pointer dereference.

Bye for now,
-- 
Laurence Withers, <lwithers at guralp.com>                http://www.guralp.com/
Direct tel:+447753988197 or tel:+443333408643               Software Engineer
General support queries: <support at guralp.com>         CMG-DCM CMG-EAM CMG-NAM


More information about the U-Boot mailing list