import: dkr - avoid NULL-pointer dereference

A malformed manifest could in principle cause a NULL pointer dereference of. Check
for this and fail early.

Fixes CID 1299642.
This commit is contained in:
Tom Gundersen
2015-05-25 22:47:42 +02:00
parent f001a83522
commit 37591152d2
+1 -1
View File
@@ -864,7 +864,7 @@ static void dkr_pull_job_on_finished_v2(PullJob *j) {
}
e = json_variant_value(doc, "fsLayers");
if (!e || e->type != JSON_VARIANT_ARRAY) {
if (!e || e->type != JSON_VARIANT_ARRAY || e->size == 0) {
r = -EBADMSG;
goto finish;
}