-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix behavior when provided a malformed parameters file (#556)
* Don't finalize parameters struct in rcl_parse_yaml_file function The function assumes that the structure has already been initialized, so it should be the callers responsibility to finalize it. Otherwise, this may lead to a double free as reported in #553. Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Return an error code if there's a malformed parameters file This restores behavior that was lost when the '__params:=' syntax was deprecated in #495. An extra guard was also added when finalizing the parameters struct. Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Refactor comment Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Add regression test Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Provide detailed error message Also warn about deprecated usage, even if there is an error parsing parameters file. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
- Loading branch information
1 parent
48cb27e
commit b6f6492
Showing
4 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
rcl/test/resources/test_arguments/test_malformed_parameters.1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
some_node: | ||
ros_parameters: | ||
int_param: 1 | ||
param_group: | ||
string_param: foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters