Messages in this thread | | | Subject | Re: [PATCH v5 10/10] x86, efi: EFI boot stub support | From | Matt Fleming <> | Date | Mon, 17 Oct 2011 19:28:17 +0100 |
| |
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
| |