|
Zbigniew Jędrzejewski-Szmek |
436654 |
From 8241402c1aadd32f1918d75d04da485430818dcb Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
Date: Mon, 25 May 2015 22:47:42 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
Subject: [PATCH] import: dkr - avoid NULL-pointer dereference
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
A malformed manifest could in principle cause a NULL pointer dereference of. Check
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
for this and fail early.
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
Fixes CID 1299642.
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
(cherry picked from commit 37591152d261ba980b8992de37ee940c9e5c5da0)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
src/import/pull-dkr.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
diff --git a/src/import/pull-dkr.c b/src/import/pull-dkr.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
index 40aca786a5..d7476dc340 100644
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
--- a/src/import/pull-dkr.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
+++ b/src/import/pull-dkr.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
@@ -864,7 +864,7 @@ static void dkr_pull_job_on_finished_v2(PullJob *j) {
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
e = json_variant_value(doc, "fsLayers");
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
- if (!e || e->type != JSON_VARIANT_ARRAY) {
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
+ if (!e || e->type != JSON_VARIANT_ARRAY || e->size == 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
r = -EBADMSG;
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
}
|