diff options
| author | Felix Fietkau | 2025-01-31 11:29:28 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2025-01-31 11:29:51 +0000 |
| commit | 75a236be122ab50df4c6b8476e8db8c20e1320b1 (patch) | |
| tree | 5072a76a176c45a71a8985ca8273e47b10f4dfe9 | |
| parent | 082b5482b97f20dc4745bc3d645e33b584cc28e4 (diff) | |
service: add missing null pointer check
Fixes crash when encountering a service without a valid member list
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rw-r--r-- | service.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -120,7 +120,8 @@ service_add(struct network *net, struct blob_attr *data) if ((cur = tb[SERVICE_ATTR_TYPE]) != NULL) type = blobmsg_get_string(cur); - if (blobmsg_check_array(tb[SERVICE_ATTR_MEMBERS], BLOBMSG_TYPE_STRING) < 0) + if (!tb[SERVICE_ATTR_MEMBERS] || + blobmsg_check_array(tb[SERVICE_ATTR_MEMBERS], BLOBMSG_TYPE_STRING) < 0) return; config = tb[SERVICE_ATTR_CONFIG]; |