summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-05-25 22:47:42 +0200
committerTom Gundersen <teg@jklm.no>2015-05-25 22:47:42 +0200
commit37591152d261ba980b8992de37ee940c9e5c5da0 (patch)
tree12afd380007e03a8e74f94299836268586ea3f2c /src
parentf001a83522284bc85c1fdc352229e58316ce0e16 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/import/pull-dkr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/import/pull-dkr.c b/src/import/pull-dkr.c
index 40aca786a5..d7476dc340 100644
--- a/src/import/pull-dkr.c
+++ b/src/import/pull-dkr.c
@@ -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;
}