core: fix NULL pointer dereference during deserialization

This commit is contained in:
Frantisek Sumsal
2023-05-03 10:09:53 +02:00
parent 24e6759cbc
commit 45b1017488
2 changed files with 15 additions and 0 deletions
+5
View File
@@ -3219,6 +3219,11 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
} else if (streq(key, "accept-socket")) {
Unit *socket;
if (u->type != UNIT_SOCKET) {
log_unit_debug(u, "Failed to deserialize accept-socket: unit is not a socket");
return 0;
}
r = manager_load_unit(u->manager, value, NULL, NULL, &socket);
if (r < 0)
log_unit_debug_errno(u, r, "Failed to load accept-socket unit '%s': %m", value);
@@ -0,0 +1,10 @@
current-job-tmp-dir=/niliclrd,ng
plymo-.sliceuth-quiwt-dir=/niliclrd,ng
plymo-.sliceuth-quiwt-ait.service
srd2043d7818E@96s
8582967570742745a94
accept-socket=runn2043ait.service
srd2043d7818E@96s
8582967570742745a94