1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-cluster: CID 1435726: NULL pointer dereference

Also found by csbuild.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2019-05-29 17:38:03 +10:00 committed by Amitay Isaacs
parent 2db0e71d3b
commit aa602a8cc5

View File

@ -38,13 +38,24 @@ static bool check_static_string_change(const char *key,
enum conf_update_mode mode)
{
if (mode == CONF_MODE_RELOAD) {
if (strcmp(old_value, new_value) != 0) {
if (old_value == new_value) {
goto done;
}
/*
* At this point old_value or new_value can not both
* NULL, so if one is NULL then they are different
*/
if (old_value == NULL ||
new_value == NULL ||
strcmp(old_value, new_value) != 0) {
D_WARNING("Ignoring update of [%s] -> %s\n",
CLUSTER_CONF_SECTION,
key);
}
}
done:
return true;
}