*/
#include <string.h>
+#include <stdlib.h>
#include <security/_pam_macros.h>
char *crypt(const char *key, const char *salt);
char *bigcrypt(const char *key, const char *salt)
{
- static char dec_c2_cryptbuf[CBUF_SIZE]; /* static storage area */
+ char *dec_c2_cryptbuf;
unsigned long int keylen, n_seg, j;
char *cipher_ptr, *plaintext_ptr, *tmp_ptr, *salt_ptr;
D(("called with key='%s', salt='%s'.", key, salt));
/* reset arrays */
+ dec_c2_cryptbuf = malloc(CBUF_SIZE);
+ if (!dec_c2_cryptbuf) {
+ return NULL;
+ }
memset(keybuf, 0, KEYBUF_SIZE + 1);
memset(dec_c2_cryptbuf, 0, CBUF_SIZE);