Check for replies pointer being NULL just in case.

This commit is contained in:
Todd C. Miller
2019-11-11 14:10:13 -07:00
parent 6863a848d6
commit ad52ce6612

View File

@@ -77,6 +77,8 @@ sudo_conversation(int num_msgs, const struct sudo_conv_message msgs[],
SET(flags, TGP_NOECHO_TRY);
read_pass:
/* Read the password unless interrupted. */
if (replies == NULL)
goto err;
pass = tgetpass(msg->msg, msg->timeout, flags, callback);
if (pass == NULL)
goto err;
@@ -130,7 +132,7 @@ sudo_conversation(int num_msgs, const struct sudo_conv_message msgs[],
err:
/* Zero and free allocated memory and return an error. */
if (replies != 0) {
if (replies != NULL) {
do {
struct sudo_conv_reply *repl = &replies[n];
if (repl->reply == NULL)