]> andersk Git - openssh.git/blobdiff - monitor_wrap.c
- (djm) [Makefile.in]
[openssh.git] / monitor_wrap.c
index 8cfc8cc08f79769b1ed0dbed2d91d0ee61b895cc..3728e5f55bdf60e8f58a2ef43628a9842b34c7e0 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_wrap.c,v 1.45 2006/03/30 09:58:15 djm Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.48 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
  * Copyright 2002 Markus Friedl <markus@openbsd.org>
 
 #include "includes.h"
 
+#include <sys/types.h>
+
 #include <openssl/bn.h>
 #include <openssl/dh.h>
 
+#include <errno.h>
+#include <pwd.h>
+#include <string.h>
+
 #include "ssh.h"
 #include "dh.h"
 #include "kex.h"
@@ -776,8 +782,11 @@ mm_sshpam_query(void *ctx, char **name, char **info,
        *name = buffer_get_string(&m, NULL);
        *info = buffer_get_string(&m, NULL);
        *num = buffer_get_int(&m);
-       *prompts = xmalloc((*num + 1) * sizeof(char *));
-       *echo_on = xmalloc((*num + 1) * sizeof(u_int));
+       if (*num > PAM_MAX_NUM_MSG)
+               fatal("%s: recieved %u PAM messages, expected <= %u",
+                   __func__, *num, PAM_MAX_NUM_MSG);
+       *prompts = xcalloc((*num + 1), sizeof(char *));
+       *echo_on = xcalloc((*num + 1), sizeof(u_int));
        for (i = 0; i < *num; ++i) {
                (*prompts)[i] = buffer_get_string(&m, NULL);
                (*echo_on)[i] = buffer_get_int(&m);
This page took 0.03156 seconds and 4 git commands to generate.