summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-11-20 07:55:08 +0000
committerdes <des@FreeBSD.org>2003-11-20 07:55:08 +0000
commitd5c8fd315b3b75b6ce12e3afacba0d9235630eec (patch)
tree079939034239e4b49295bf3329b5efe829b47066 /contrib
parent26c79419e1c3178631ab3675e3125d9e4c5f0a0c (diff)
parent309ac786af61b444cb6e18370b17c1a5bb8bc45f (diff)
downloadFreeBSD-src-d5c8fd315b3b75b6ce12e3afacba0d9235630eec.zip
FreeBSD-src-d5c8fd315b3b75b6ce12e3afacba0d9235630eec.tar.gz
This commit was generated by cvs2svn to compensate for changes in r122912,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/openpam/lib/openpam_ttyconv.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/contrib/openpam/lib/openpam_ttyconv.c b/contrib/openpam/lib/openpam_ttyconv.c
index 48fe70a..1b91f16 100644
--- a/contrib/openpam/lib/openpam_ttyconv.c
+++ b/contrib/openpam/lib/openpam_ttyconv.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/openpam_ttyconv.c#22 $
+ * $P4: //depot/projects/openpam/lib/openpam_ttyconv.c#23 $
*/
#include <sys/types.h>
@@ -179,13 +179,13 @@ openpam_ttyconv(int n,
resp[i]->resp = NULL;
switch (msg[i]->msg_style) {
case PAM_PROMPT_ECHO_OFF:
- resp[i]->resp = prompt_echo_off(msg[i]->msg);
- if (resp[i]->resp == NULL)
+ (*resp[i]).resp = prompt_echo_off(msg[i]->msg);
+ if ((*resp[i]).resp == NULL)
goto fail;
break;
case PAM_PROMPT_ECHO_ON:
- resp[i]->resp = prompt(msg[i]->msg);
- if (resp[i]->resp == NULL)
+ (*resp[i]).resp = prompt(msg[i]->msg);
+ if ((*resp[i]).resp == NULL)
goto fail;
break;
case PAM_ERROR_MSG:
@@ -206,11 +206,13 @@ openpam_ttyconv(int n,
}
RETURNC(PAM_SUCCESS);
fail:
- while (i)
- if (resp[--i]->resp) {
- memset(resp[i]->resp, 0, strlen(resp[i]->resp));
- FREE(resp[i]->resp);
+ for (i = 0; i < n; ++i) {
+ if ((*resp[i]).resp != NULL) {
+ memset((*resp[i]).resp, 0, strlen((*resp[i]).resp));
+ FREE((*resp[i]).resp);
}
+ }
+ memset(*resp, 0, n * sizeof **resp);
FREE(*resp);
RETURNC(PAM_CONV_ERR);
}
OpenPOWER on IntegriCloud