From: Todd C. Miller Date: Fri, 5 Mar 2010 22:13:42 +0000 (-0500) Subject: Handle NULL reply from conversation function X-Git-Tag: SUDO_1_8_0~845 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e131d4278158006c17e4c6326dae4acc418eb6d;p=sudo Handle NULL reply from conversation function --- diff --git a/plugins/sample/sample_plugin.c b/plugins/sample/sample_plugin.c index 230e30c81..32a72814c 100644 --- a/plugins/sample/sample_plugin.c +++ b/plugins/sample/sample_plugin.c @@ -189,6 +189,10 @@ policy_check(int argc, char * const argv[], msg.msg = "Password: "; memset(&repl, 0, sizeof(repl)); sudo_conv(1, &msg, &repl); + if (repl.reply == NULL) { + sudo_log(SUDO_CONV_ERROR_MSG, "missing password"); + return FALSE; + } if (strcmp(repl.reply, "test") != 0) { sudo_log(SUDO_CONV_ERROR_MSG, "incorrect password"); return FALSE;