From: Martin Schwenke Date: Mon, 24 Jun 2019 06:45:06 +0000 (+1000) Subject: ctdb-event: Fix signed/unsigned comparisons by casting X-Git-Tag: samba-4.11.0rc1~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba95cb2ae1564edc27541c2a87e35f338e4653f7;p=thirdparty%2Fsamba.git ctdb-event: Fix signed/unsigned comparisons by casting Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/event/event_conf.c b/ctdb/event/event_conf.c index 33bfc7c5335..61ecf8e33eb 100644 --- a/ctdb/event/event_conf.c +++ b/ctdb/event/event_conf.c @@ -50,7 +50,7 @@ static bool event_conf_validate_debug_script(const char *key, "%s/%s", path_etcdir(), basename(script)); - if (ret >= sizeof(script_path)) { + if (ret < 0 || (size_t)ret >= sizeof(script_path)) { D_ERR("debug script path too long\n"); return false; } diff --git a/ctdb/event/event_tool.c b/ctdb/event/event_tool.c index 6cc5dc9a822..9c95e6d9553 100644 --- a/ctdb/event/event_tool.c +++ b/ctdb/event/event_tool.c @@ -408,7 +408,7 @@ static int event_command_script_list(TALLOC_CTX *mem_ctx, } len = readlink(e->path, buf, sizeof(buf)); - if (len == -1 || len >= sizeof(buf)) { + if (len == -1 || (size_t)len >= sizeof(buf)) { /* * Not a link? Disappeared? Invalid * link target? Something else?