ehlo, Ensure that cmd_ctx->name will not be NULL.
If cmd_ctx->name was not initialized by sss_parse_name then copy of name will be used. https://fedorahosted.org/sssd/ticket/1970 Coverity ID: 11647 Patch is attached. LS
>From f288642f68a142fff0da97850823598d7023866d Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik <lsleb...@redhat.com> Date: Tue, 30 Jul 2013 09:06:19 +0200 Subject: [PATCH] SSH: Ensure that cmd_ctx->name will not be NULL. If cmd_ctx->name was not initialized by sss_parse_name then copy of name will be used. https://fedorahosted.org/sssd/ticket/1970 Coverity ID: 11647 --- src/responder/ssh/sshsrv_cmd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/responder/ssh/sshsrv_cmd.c b/src/responder/ssh/sshsrv_cmd.c index 76c3643506ffa1155a95750f96ee84305b1b317d..5d6699715e9dfd766e2c9c8a752b331b516d049c 100644 --- a/src/responder/ssh/sshsrv_cmd.c +++ b/src/responder/ssh/sshsrv_cmd.c @@ -752,6 +752,11 @@ ssh_cmd_parse_request(struct ssh_cmd_ctx *cmd_ctx) name = cmd_ctx->name; } + if (cmd_ctx->name == NULL) { + cmd_ctx->name = talloc_strdup(cmd_ctx, name); + if (!cmd_ctx->name) return ENOMEM; + } + if (cmd_ctx->is_user && cmd_ctx->domname == NULL) { DEBUG(SSSDBG_TRACE_FUNC, ("Parsing name [%s][%s]\n", name, domain ? domain : "<ALL>")); @@ -765,10 +770,7 @@ ssh_cmd_parse_request(struct ssh_cmd_ctx *cmd_ctx) ("Invalid name received [%s]\n", name)); return ENOENT; } - } else if (cmd_ctx->name == NULL && cmd_ctx->domname == NULL) { - cmd_ctx->name = talloc_strdup(cmd_ctx, name); - if (!cmd_ctx->name) return ENOMEM; - + } else if (cmd_ctx->domname == NULL) { if (domain != NULL) { cmd_ctx->domname = talloc_strdup(cmd_ctx, domain); if (!cmd_ctx->domname) return ENOMEM; -- 1.8.3.1
_______________________________________________ sssd-devel mailing list sssd-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/sssd-devel