From: Ralf Habacker Date: Tue, 14 Apr 2015 21:48:23 +0000 (+0200) Subject: include_dir: skip processing on error (CID 54744) X-Git-Tag: dbus-1.9.16~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26a3c0dc5b2ad10e22a0c5b4a745e5b008bee2b7;p=thirdparty%2Fdbus.git include_dir: skip processing on error (CID 54744) We already skipped processing for DBUS_ERROR_FILE_NOT_FOUND; but if the error was something else, we would pass the NULL pointer dir to _dbus_directory_get_next_file(), which dereferences it. Reported by Coverity: CID 54744: Dereference after null check (FORWARD_NULL) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 [smcv: re-worded commit message] Reviewed-by: Simon McVittie --- diff --git a/bus/config-parser.c b/bus/config-parser.c index 1540fe435..3f59730b1 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -2271,6 +2271,8 @@ include_dir (BusConfigParser *parser, dbus_error_free (error); goto success; } + else + goto failed; } dbus_error_init (&tmp_error);