Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmd.c:1002

Categories: LANG.MEM.NPD CWE:476
Warning ID: 271.28941
Procedure: main
Trace: view
Modified: Thu Nov 26 11:28:59 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
   /kat0/fletcher/SATE/2010/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);   /* File System Race Condition (ID: 272.28943) */
 965         (void)open("/dev/null", O_RDONLY, 0);   /* File System Race Condition (ID: 272.28942) */
 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
((char*)&$heap_310148)[1] <= 120
((char*)&$heap_310148)[1] >= 48
$input_12 >= 1
$input_194148 >= 0
$input_444 = 48
td = 0
Postconditions
*stdin' is allocated by fopen
bytes_before(stdin)' = 0
errno' != 0
$heap_310145' is allocated by open
$heap_310145' is allocated
$heap_310146' is allocated by open
$heap_310146' is allocated
$heap_310147' is allocated by open
$heap_310147' is allocated
$heap_310148' = $input_444
bytes_after(&$heap_310148)' = $input_12 + 1
$heap_310148' is allocated by malloc
$heap_310148' is a non-heap object
bytes_before(&$heap_310148)' = 0
strlen(&$heap_310148)' = $input_12
$heap_310149' = $input_194156
bytes_after(&$heap_310149)' = $input_194148 + 1
$heap_310149' is allocated by malloc
$heap_310149' is a non-heap object
bytes_before(&$heap_310149)' = 0
strlen(&$heap_310149)' = $input_194148
name' = &#string0[0]
p' = &$heap_310148
pe' = &stored_passwd.pw_name
pvm_useruid' != -1
td' = &$heap_310149
testmode' = 0




Change Warning 271.28941 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: