mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-24 23:18:23 +00:00
system/nxinit: add check loop to init_parse_config_buffer
Add the parser[n].check validation loop to init_parse_config_buffer(), matching the same pattern already used in init_parse_config_file(). This ensures that services and actions parsed from in-memory buffers are properly validated after parsing. Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
63eb6c79f2
commit
e0a1031bcc
1 changed files with 12 additions and 0 deletions
|
|
@ -139,6 +139,18 @@ static int init_parse_config_buffer(FAR const struct parser_s *parser,
|
|||
}
|
||||
}
|
||||
|
||||
for (n = 0; parser[n].key; n++)
|
||||
{
|
||||
if (parser[n].check)
|
||||
{
|
||||
ret = parser[n].check(&parser[n]);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue