mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
varlink: don't panic on malformed method definition
This commit is contained in:
parent
13de7c7e66
commit
779e7b4410
@ -986,6 +986,9 @@ int varlink_idl_parse(
|
||||
assert(!symbol);
|
||||
n_fields = 0;
|
||||
|
||||
if (!token)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "%u:%u: Premature EOF.", *line, *column);
|
||||
|
||||
r = varlink_symbol_realloc(&symbol, n_fields);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@ -1004,6 +1007,9 @@ int varlink_idl_parse(
|
||||
case STATE_METHOD_ARROW:
|
||||
assert(symbol);
|
||||
|
||||
if (!token)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "%u:%u: Premature EOF.", *line, *column);
|
||||
|
||||
if (!streq(token, "->"))
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "%u:%u: Unexpected token '%s'.", *line, *column, token);
|
||||
|
||||
@ -1025,6 +1031,9 @@ int varlink_idl_parse(
|
||||
assert(!symbol);
|
||||
n_fields = 0;
|
||||
|
||||
if (!token)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "%u:%u: Premature EOF.", *line, *column);
|
||||
|
||||
r = varlink_symbol_realloc(&symbol, n_fields);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@ -1050,6 +1059,9 @@ int varlink_idl_parse(
|
||||
assert(!symbol);
|
||||
n_fields = 0;
|
||||
|
||||
if (!token)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "%u:%u: Premature EOF.", *line, *column);
|
||||
|
||||
r = varlink_symbol_realloc(&symbol, n_fields);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
BIN
test/fuzz/fuzz-varlink-idl/crash-d1860f2b
Normal file
BIN
test/fuzz/fuzz-varlink-idl/crash-d1860f2b
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user