Skip to content

Assorted coverity fixes

Petr Menšík requested to merge pemensik/bind9:bug/main/new-zones-dir-null into main

dir can be NULL in case of wrong network syntax. Ensure permissions are tested only on non-NULL path.

Detected by coverity scan, I think it is valid.

 8. bind-9.16.23/bin/named/server.c:7602: var_compare_op: Comparing "dir" to null implies that "dir" might be null.
10. bind-9.16.23/bin/named/server.c:7612: var_deref_model: Passing null pointer "dir" to "isc_file_isdirwritable", which dereferences it.
#  7610|   			return (result);
#  7611|   		}
#  7612|-> 		if (!isc_file_isdirwritable(dir)) {
#  7613|   			isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
#  7614|   				      NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
Edited by Petr Špaček

Merge request reports