mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
varlink: don't panic on malformed method definition
This commit is contained in:
@@ -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.
Reference in New Issue
Block a user