lkml.org 
[lkml]   [2011]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 10/10] x86, efi: EFI boot stub support
From
Date
On Mon, 2011-10-17 at 18:39 +0200, Maarten Lankhorst wrote:
> > + if (options_size) {
> > + if (options_size > hdr->cmdline_size)
> > + options_size = hdr->cmdline_size;
> > +
> > + options_size++; /* NUL termination */
> > +
> > + status = low_alloc(options_size, 1, &cmdline);
> > + if (status != EFI_SUCCESS)
> > + goto fail;
> Shouldn't this be options_size + 1?

Nope. Notice the options_size++ above the allocation.

> > +
> > + s1 = (u8 *)(unsigned long)cmdline;
> > + s2 = (u16 *)options;
> > +
> > + for (i = 0; i < options_size - 1; i++)
> > + *s1++ = *s2++;

And the options_size - 1 here.

> > +
> > + *s1 = '\0';
> For this null character..

So this should all work OK.

--
Matt Fleming, Intel Open Source Technology Center



\
 
 \ /
  Last update: 2011-10-17 20:31    [W:0.822 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site