Browse Source

retention: blinfo: Fix issue with crash writing to keys

Fixes an issue which would cause a fault if someone attempted
to write to the (non-writable) blinfo keys

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
pull/63863/head
Jamie McCrae 2 years ago committed by Fabio Baltieri
parent
commit
65bb96f37c
  1. 7
      subsys/retention/blinfo_mcuboot.c

7
subsys/retention/blinfo_mcuboot.c

@ -78,10 +78,12 @@ int blinfo_lookup(uint16_t key, char *val, int val_len_max) @@ -78,10 +78,12 @@ int blinfo_lookup(uint16_t key, char *val, int val_len_max)
#if defined(CONFIG_RETENTION_BOOTLOADER_INFO_OUTPUT_SETTINGS)
static int blinfo_handle_get(const char *name, char *val, int val_len_max);
static int blinfo_handle_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg);
static struct settings_handler blinfo_handler = {
.name = "blinfo",
.h_get = blinfo_handle_get,
.h_set = blinfo_handle_set,
};
static int blinfo_handle_get(const char *name, char *val, int val_len_max)
@ -110,6 +112,11 @@ static int blinfo_handle_get(const char *name, char *val, int val_len_max) @@ -110,6 +112,11 @@ static int blinfo_handle_get(const char *name, char *val, int val_len_max)
return blinfo_lookup(index, val, val_len_max);
}
static int blinfo_handle_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg)
{
return -ENOTSUP;
}
#endif
static int blinfo_init(void)

Loading…
Cancel
Save