Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at pvmd.c:1002

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2694.2746
Procedure: main
Trace: View
Modified: Wed Sep 2 12:43:39 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /u1/paul/SATE/2010/c/pvm/pvm3/src/pvmd.c
   Enter main
 947 main(argc, argv) 
 948         int argc;
 949         char **argv;
 950 {
 951         int i, j;
 952         char *name = "";
 953         struct passwd *pe;
 954         int testmode = 0;
 955         struct timeval tnow;
 956         char buf[128];
 957  
 958 #ifndef WIN32 
 959         /* check for extension config options */ 
 960         check_ext_input();
 961  
 962         /* make sure 0, 1, 2 are in use */ 
 963         (void)open("/dev/null", O_RDONLY, 0);
 964         (void)open("/dev/null", O_RDONLY, 0);
 965         (void)open("/dev/null", O_RDONLY, 0);
 966 #else 
 967         /* WSAStartup has to be called before any socket command */ 
 968         /* can be executed. Why ? Ask Bill   */ 
 969  
 970         if (WSAStartup(0x0101, &WSAData) != 0) {
 971               printf("\nWSAStartup() failed\n");
 972               ExitProcess(1);
 973         }
 974         setsockopt(INVALID_SOCKET,SOL_SOCKET,SO_OPENTYPE,
 975                         (char *)&nAlert,sizeof(int));
 976         osinfo=malloc(sizeof(OSVERSIONINFO));
 977         osinfo->dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
 978         GetVersionEx(osinfo);
 979         os_is_NT= ( osinfo->dwPlatformId == VER_PLATFORM_WIN32_NT); 
 980 #endif 
 981  
 982         {
 983                 char *p;
 984                 if (p = getenv("PVMDDEBUG"))
 985                         pvmdebmask = pvmstrtoi(p);
 986         }
 987  
 988 #ifndef WIN32 
 989         if ((pvm_useruid = getuid()) == -1) {
 990                 pvmlogerror("main() can't getuid()\n");
 991                 pvmbailout(0);
 992         }
 993         pvmchkuid( pvm_useruid );
 994 #else 
 995         username = MyGetUserName(); 
 996 #endif 
 997  
 998         pvmsetlog(3);
 999  
 1000 #ifndef WIN32 
 1001         if (pe = getpwuid(pvm_useruid))
true1002                 username = STRALLOC(pe->pw_name);     /* Null Pointer Dereference */
Preconditions
$input_12 >= 0
$input_60 != 48
Postconditions
*log_ff->_flags' is freed
*log_ff->_flags' is closed
log_ff->_flags' is closed
argc' = $param_1
argv' = $param_2
errno' != 0
$heap_159361' is allocated by open
$heap_159361' is allocated
((char*)&$heap_159361)[-4096]' is open
$heap_159362' = $input_60
bytes_after(&$heap_159362)' = $input_12 + 1
$heap_159362' is allocated by malloc
$heap_159362' is a non-heap object
bytes_before(&$heap_159362)' = 0
strlen(&$heap_159362)' = $input_12
log_fd' = -1
log_ff' = 0
log_how' = 3
name' = &#string0[0]
p' = &$heap_159362
pe' = &stored_passwd.pw_name
pvm_useruid' != -1
pvmdebmask' = $input_62404
testmode' = 0




Change Warning 2694.2746 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: