On Tue, Sep 04, 2018 at 06:06:44PM +0200, Jan Kiszka wrote: > On 2018-09-03 16:09, [ext] Andreas J. Reichel wrote: > > From: Andreas Reichel <[email protected]> > > > > + > > + filtered_volumes = mmalloc(sizeof(UINTN) * *numHandles); > > Missing NULL check. That will actually give the function an error path. > > Alternatively, you could sort all volumes you want to keep to the beginning > of the existing array and only adjust *numHandles. Then you could actually > return that value because there will be no error code anymore, and that > would simplify also the caller. > Thanks. Good idea. > > + > > + Print(L"Booting with environments from boot device only.\n"); > > + UINTN index = 0; > > + for (UINTN j = 0; j < *numHandles; j++) { > > + UINTN cvi = (*config_volumes)[j]; > > + VOLUME_DESC *v = &volumes[cvi]; > > + > > + if (IsOnBootDevice(v->devpath)) { > > + filtered_volumes[index++] = (*config_volumes)[j]; > > + } else { > > + Print(L"Filtered out config on volume #%d\n", cvi); > > Maybe "Ignoring config on..."? > > > + } > > + } > > + *numHandles = index; > > + > > + mfree(*config_volumes); > > + *config_volumes = filtered_volumes; > > + Print(L"Remaining Config Partitions: %d\n", *numHandles); > > Do we need that verbosity level? I don't see the value for the user yet. > I will better make that an optional debug output.
Andreas -- Andreas Reichel Dipl.-Phys. (Univ.) Software Consultant [email protected], +49-174-3180074 TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterfoehring Geschaeftsfuehrer: Henrik Klagges, Dr. Robert Dahlke, Gerhard Mueller Sitz: Unterfoehring * Amtsgericht Muenchen * HRB 135082 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/20180905111451.GC14836%40iiotirae. For more options, visit https://groups.google.com/d/optout.
