Show
Ignore:
Timestamp:
01/03/04 12:05:24 (5 years ago)
Author:
patrickh
Message:

Avoid a NULL pointer dereference if the environment variable DISPLAY is not
defined.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/RELENG_1_0/juggler_1.0/Kernel/Pf/vjPfDrawManager.cpp

    r14083 r14114  
    116116         char env_var[] = "DISPLAY"; 
    117117         char* display_env = getenv(env_var); 
    118          char* xpipe_name  = new char[strlen(display_env)+1]; 
    119          strcpy(xpipe_name, display_env); 
    120          mPipeStrs[i] = xpipe_name; 
     118         if ( NULL != display_env ) 
     119         { 
     120            char* xpipe_name = new char[strlen(display_env)+1]; 
     121            strcpy(xpipe_name, display_env); 
     122            mPipeStrs[i] = xpipe_name; 
     123         } 
    121124      } 
    122125      vjDEBUG(vjDBG_DRAW_MGR,vjDBG_CONFIG_LVL) << "Pipe:" << i << ": "