1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

ctdb: Fix posible NULL deref in logging_init()

Found by covscan.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Andreas Schneider 2017-02-16 17:38:41 +01:00 committed by Jeremy Allison
parent a9211ec286
commit 08e03fa7f5

View File

@ -521,7 +521,14 @@ int logging_init(TALLOC_CTX *mem_ctx, const char *logging,
}
name = strtok(str, ":");
if (name == NULL) {
return EINVAL;
}
option = strtok(NULL, ":");
/*
* option can be NULL here, both setup()
* backends handle this.
*/
for (i=0; i<ARRAY_SIZE(log_backend); i++) {
if (strcmp(log_backend[i].name, name) == 0) {