]> granicus.if.org Git - sudo/commitdiff
Handle NULL reply from conversation function
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 5 Mar 2010 22:13:42 +0000 (17:13 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 5 Mar 2010 22:13:42 +0000 (17:13 -0500)
plugins/sample/sample_plugin.c

index 230e30c81ea10695fa93eb8d0d240893eee5aad4..32a72814cfadd0663c791188f77532d504515808 100644 (file)
@@ -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;