OSDN Git Service

Handle validation of inputs in efi_loadopt_create() better.
authorPeter Jones <pjones@redhat.com>
Mon, 13 Jul 2015 17:40:21 +0000 (13:40 -0400)
committerPeter Jones <pjones@redhat.com>
Mon, 13 Jul 2015 17:42:36 +0000 (13:42 -0400)
commitd07807c80cffa32460c10ddb0f76ac49d9c00387
treedba9c3765e039f0bfe01562dfd6d632ef35bfafa
parent6eb7179d193d5df6e1a8d861c3348bc18ac25a64
Handle validation of inputs in efi_loadopt_create() better.

efibootmgr tries to tell how much space it needs to allocate by passing
in optional_data=NULL, optional_data_size=$SOMESIZE, and we're
validating that both things are set way too early.

Move that until after the "if (size==0) return sz;" check.

Based on the bug report in issue#22 and pull#27 .

Signed-off-by: Peter Jones <pjones@redhat.com>
src/loadopt.c