File gpm-1.20.1-Gpm_Open.patch of Package gpm

--- src/lib/liblow.c
+++ src/lib/liblow.c
@@ -199,7 +199,7 @@
    Gpm_Stst *new = NULL;
    char* sock_name = 0;
 
-   option.consolename = NULL;
+   if (checked_con == 0) option.consolename = NULL;
 
    gpm_report(GPM_PR_DEBUG,"VC: %d",flag);
 
@@ -257,6 +257,10 @@
             gpm_report(GPM_PR_ERR,"checking tty name failed");
             goto err;
          }   
+         if (option.consolename == NULL) {
+            gpm_report(GPM_PR_ERR,"option.consolename not set");
+            goto err;
+         }   
          /* do we really need this check ? */
          if(strncmp(tty,option.consolename,strlen(option.consolename)-1)
             || !isdigit(tty[strlen(option.consolename)-1])) {
openSUSE Build Service is sponsored by