a78bee9
diff -Naur apg-2.3.0b-orig/restrict.c apg-2.3.0b/restrict.c
a78bee9
--- apg-2.3.0b-orig/restrict.c	2003-08-07 11:40:39.000000000 -0400
a78bee9
+++ apg-2.3.0b/restrict.c	2012-04-23 15:01:38.968745907 -0400
a78bee9
@@ -54,6 +54,10 @@
a78bee9
  FILE *dct;
a78bee9
  char *string;
a78bee9
  char *tmp;
a78bee9
+
a78bee9
+ if( pass == NULL)
a78bee9
+   return(-1);
a78bee9
+
a78bee9
  if( (string = (char *) calloc(1,MAX_DICT_STRING_SIZE)) == NULL)
a78bee9
    return(-1);
a78bee9
  
a78bee9
@@ -140,13 +144,17 @@
a78bee9
 paranoid_bloom_check_pass (char * password, char *filter, USHORT s_len)
a78bee9
 {
a78bee9
  char * substring;
a78bee9
- int len = strlen(password); /* string length                      */
a78bee9
+ int len = 0;
a78bee9
  int c_substr_start_pos = 0; /* current start position             */
a78bee9
  int substr_len = 0;         /* substring length (LEN-I >= substr_len >= 2) */
a78bee9
  int k = 0;                  /* counter                            */
a78bee9
  int c = 0;                  /* counter                            */
a78bee9
  int ret = 0;
a78bee9
  if (s_len < 2) s_len = 2;
a78bee9
+ if(password == NULL)
a78bee9
+   return (-1);
a78bee9
+
a78bee9
+ len = strlen(password); /* string length                      */
a78bee9
  if (s_len > len) return (bloom_check_pass(password, filter));
a78bee9
 
a78bee9
 #ifdef APG_DEBUG
a78bee9
@@ -203,16 +211,19 @@
a78bee9
 cracklib_check_pass(char *pw, char *dictpath)
a78bee9
 {
a78bee9
  char * msg;
a78bee9
- msg = FascistCheck(pw,dictpath);
a78bee9
- if (msg == NULL) return (0);
a78bee9
- else
a78bee9
+ if( pw != NULL)
a78bee9
   {
a78bee9
+   msg = FascistCheck(pw,dictpath);
a78bee9
+   if (msg == NULL) return (0);
a78bee9
+   else
a78bee9
+    {
a78bee9
 #ifdef APG_DEBUG
a78bee9
-   fprintf(stdout,"cracklib_check_pass: password --> %s rejected (%s)\n", pw, msg);
a78bee9
-   fflush(stdout);
a78bee9
+     fprintf(stdout,"cracklib_check_pass: password --> %s rejected (%s)\n", pw, msg);
a78bee9
+     fflush(stdout);
a78bee9
 #endif
a78bee9
-   return (1);
a78bee9
+    }
a78bee9
   }
a78bee9
+  return (1);
a78bee9
 }
a78bee9
 #endif
a78bee9
 
a78bee9
@@ -245,6 +256,9 @@
a78bee9
  fflush (stdout);
a78bee9
 #endif /* APG_DEBUG */
a78bee9
 
a78bee9
+if(word == NULL)
a78bee9
+ return(0);
a78bee9
+
a78bee9
  if ((cond & S_SS) > 0)
a78bee9
     for (i=0; i < 94; i++)
a78bee9
        if ((smbl[i].type & S_SS) > 0)