Description: fix mtink crash when run with an empty environment
 Running 'env -i /usr/bin/mtink' results in a segfault.
 This patch avoids operations on NULL string pointers.
Bug-Debian: http://bugs.debian.org/716543
Author: Graham Inggs <graham@nerve.org.za>
Forwarded: No
Last-Update: 2013-07-31
--- a/mainSrc/checkenv.c
+++ b/mainSrc/checkenv.c
@@ -232,15 +232,20 @@
    {
       m = u;
    }
-   if ( strlen(m) > 256 )
-   {
-      return 0;
-   }
-   while ( *m )
-   {
-      if ( !isprint(*m) || isspace(*m) )
+   if ( m != NULL )
+   {
+      if( strlen(m) > 256 )
+      {
          return 0;
-      m++;
+      }
+      while ( *m )
+      {
+         if ( !isprint(*m) || isspace(*m) )
+         {
+            return 0;
+         }
+         m++;
+      }
    }
    
    /* check the PATH variable */
