> On 19. Jan 2021, at 03:24, Ravi Pokala <[email protected]> wrote: > > Hi Toomas, > > -----Original Message----- > From: <[email protected]> on behalf of Toomas Soome > <[email protected]> > Date: 2021-01-16, Saturday at 00:23 > To: <[email protected]>, <[email protected]>, > <[email protected]> > Subject: git: ad1ebbe5cea8 - main - loader: create local copy of mode list > provided by vbeinfoblock > > The branch main has been updated by tsoome: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=ad1ebbe5cea8ffac0037966990ddf0f80faa55d5 > > commit ad1ebbe5cea8ffac0037966990ddf0f80faa55d5 > Author: Toomas Soome <[email protected]> > AuthorDate: 2021-01-16 10:18:32 +0000 > Commit: Toomas Soome <[email protected]> > CommitDate: 2021-01-16 10:23:22 +0000 > > loader: create local copy of mode list provided by vbeinfoblock > > Apparently some systems do corrupt mode list memory area, so we need > to use local copy instead. > > ... > > + vbe_mode_list_size = (uintptr_t)p - (uintptr_t)ml; > + vbe_mode_list = malloc(vbe_mode_list_size); > + if (vbe_mode_list == NULL) { > + free(vbe); > + vbe = NULL; > + free(vbe_mode); > + vbe_mode = NULL; > + } > + bcopy(ml, vbe_mode_list, vbe_mode_list_size); > + > + /* reset VideoModePtr, so we will not have chance to use bad data. */ > + vbe->VideoModePtr = 0; > > If allocation of vbe_mode_list failed, you're freeing things that were > allocated before it, but then you're continuing on. The very next thing you > do is the bcopy(), which dereferences vbe_mode_list, which is NULL because of > the allocation failure. > > That doesn't seem right. > > Thanks, > > Ravi (rpokala@) > >
yes, thanks! I do have fix waiting for any additional comments (Yuri Pankov was very kind to provide review feedback). So the update will be posted soon. thanks, toomas _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main To unsubscribe, send any mail to "[email protected]"
