commit 535b978a53dec091d96badf9302ae2a8a25bb276
parent fce4e045a8dfea225eac35fbf3d20ff3a67d4b41
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 10 Nov 2016 11:52:15 +0100
Fix the parse_string function
Return an error if the submitted string is empty.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/solstice_parser.c b/src/solstice_parser.c
@@ -250,7 +250,8 @@ parse_string(const char* filename, yaml_node_t* string)
res_T res = RES_OK;
ASSERT(string);
- if(string->type != YAML_SCALAR_NODE) {
+ if(string->type != YAML_SCALAR_NODE
+ || !strlen((char*)string->data.scalar.value)) {
log_err(filename, string, "expect a character string.\n");
res = RES_BAD_ARG;
goto error;