Skip to content
Snippets Groups Projects
Commit 1e7bcd89 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

config: ensure that both ABI and MODULE are specified before the properties

If we have properties, strtok will return strings from there as tokens
and the error will appear later as we will attempt to parse an incomplete
GVariant. It is better to catch this early so that we can print a more
useful error message.
parent 22699a4b
No related branches found
No related tags found
No related merge requests found
......@@ -152,7 +152,9 @@ parse_commands_file (struct WpDaemonData *d, GInputStream * stream,
abi = strtok_r (NULL, " ", &saveptr);
module = strtok_r (NULL, " ", &saveptr);
if (!abi || !module) {
if (!abi || !module ||
(abi && abi[0] == '{') || (module && module[0] == '{'))
{
g_set_error (error, WP_DOMAIN_DAEMON, WP_CODE_INVALID_ARGUMENT,
"expected ABI and MODULE at line %i", lineno);
return FALSE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment