Settings: Improve error handling of settings load
if base64_decode function returns error, function can't continue
otherwise a fatal error will cause the thread to spin, putting the
system into an unrecoverable state
Signed-off-by: Faisal Saleem <faisal.saleem@setec.com.au>
diff --git a/subsys/settings/src/settings_line.c b/subsys/settings/src/settings_line.c
index 5a5121e..163b325 100644
--- a/subsys/settings/src/settings_line.c
+++ b/subsys/settings/src/settings_line.c
@@ -328,6 +328,11 @@
rc = base64_decode(dec_buf, sizeof(dec_buf), &olen, enc_buf,
read_size);
+
+ if (rc) {
+ return rc;
+ }
+
dec_buf[olen] = 0;
clen = MIN(olen + off_begin - off, rem_size);