From e7ca5345d7c54b075435076d3400045a44bf8f88 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 30 Oct 2015 12:57:07 +0100 Subject: [PATCH] CID 22509: Dereference null return value (NULL_RETURNS) potential problems at the edge of the map. --- src/kernel/connection.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/kernel/connection.c b/src/kernel/connection.c index 5bccfafd6..eecbd6c59 100644 --- a/src/kernel/connection.c +++ b/src/kernel/connection.c @@ -117,9 +117,11 @@ void walk_connections(region *r, void(*cb)(connection *, void *), void *data) { walk_i(r, borders[key], cb, data); for (d = 0; d != MAXDIRECTIONS; ++d) { region *rn = r_connect(r, d); - int k = reg_hashkey(rn); - if (k < key) { - walk_i(r, borders[k], cb, data); + if (rn) { + int k = reg_hashkey(rn); + if (k < key) { + walk_i(r, borders[k], cb, data); + } } } }