Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <stdint.h>
#include <asm/byteorder.h>
#include <stdint.h>
#include <asm/byteorder.h>
4 + optional_strlen(opt->icon_file) +
4 + optional_strlen(opt->boot_image_file) +
4 + optional_strlen(opt->initrd_file) +
4 + optional_strlen(opt->icon_file) +
4 + optional_strlen(opt->boot_image_file) +
4 + optional_strlen(opt->initrd_file) +
- 4 + optional_strlen(opt->boot_args);
+ 4 + optional_strlen(opt->boot_args) +
+ sizeof(opt->is_default);
}
int pb_protocol_boot_len(const struct boot_command *boot)
}
int pb_protocol_boot_len(const struct boot_command *boot)
pos += pb_protocol_serialise_string(pos, opt->initrd_file);
pos += pb_protocol_serialise_string(pos, opt->boot_args);
pos += pb_protocol_serialise_string(pos, opt->initrd_file);
pos += pb_protocol_serialise_string(pos, opt->boot_args);
+ *(bool *)pos = opt->is_default;
+ pos += sizeof(bool);
+
assert(pos <= buf + buf_len);
(void)buf_len;
assert(pos <= buf + buf_len);
(void)buf_len;
if (read_string(opt, &pos, &len, &opt->boot_args))
goto out;
if (read_string(opt, &pos, &len, &opt->boot_args))
goto out;
+ if (len < sizeof(bool))
+ goto out;
+ opt->is_default = *(bool *)(pos);
+
#ifndef _TYPES_H
#define _TYPES_H
#ifndef _TYPES_H
#define _TYPES_H
#include <list/list.h>
struct device {
#include <list/list.h>
struct device {
char *boot_image_file;
char *initrd_file;
char *boot_args;
char *boot_image_file;
char *initrd_file;
char *boot_args;