Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at lpvm.c:3671

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2837.2898
Procedure: pvm_start_pvmd
Trace: View
Modified: Wed Sep 2 12:49:34 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/lpvm.c
   Enter pvm_start_pvmd
 3526 pvm_start_pvmd(argc, argv, block) 
 3527         int argc;               /* number of args to pass to pvmd (>= 0) */ 
 3528         char **argv;    /* args for pvmd or null */ 
 3529         int block;              /* if true, don't return until add hosts are started */ 
 3530 {
 3531         char *sfn;
 3532         struct stat sb;
 3533         int cc;
 3534         char *fn;                       /* file to exec */ 
 3535         char **av;
 3536         int pfd[2];
   ...
 3541 #ifdef WIN32 
 3542         char *pathending = "\\lib\\win32\\pvmd3.exe";
 3543         SECURITY_ATTRIBUTES saPipe;
 3544         PROCESS_INFORMATION pi;
 3545         STARTUPINFO si;  /* for CreateProcess call */ 
 3546         HANDLE pvmdid;
 3547         int i = 0;
 3548         char cmd[256]; 
 3549 #endif 
 3550  
 3551         TEV_DECLS;
 3552  
 3553         if (TEV_EXCLUSIVE) {
 3554                 if (pvmmytid != -1 
 3555                                 && TEV_DO_TRACE(TEV_START_PVMD,TEV_EVENT_ENTRY)) {
 3556                         TEV_PACK_INT( TEV_DID_BF, TEV_DATA_SCALAR, &block, 1, 1 );
 3557                         TEV_PACK_STRING( TEV_DID_AS, TEV_DATA_ARRAY,
 3558                                 argv, argc, 1 );
 3559                         TEV_FIN;
 3560                 }
 3561         }
 3562  
 3563         if (argc < 0 || !argv)
 3564                 argc = 0;
 3565  
 3566 #ifndef WIN32 
 3567         if ((pvm_useruid = getuid()) == -1) {
 3568                 pvmlogerror("can't getuid()\n");
 3569                 cc = PvmSysErr;
 3570                 goto bail;
 3571         }
 3572         pvmchkuid( pvm_useruid );
 3573 #else 
 3574         if (!username)  
 3575                 username = MyGetUserName(); 
 3576 #endif 
 3577  
 3578         if (!(sfn = pvmdsockfile())) {
 3579                 pvmlogerror("pvm_start_pvmd() pvmdsockfile() failed\n");
 3580                 cc = PvmSysErr;
 3581                 goto bail;
 3582         }
 3583  
 3584         if (stat(sfn, &sb) != -1) {
 3585                 cc = PvmDupHost;
 3586                 goto bail;
 3587         }
 3588  
 3589 #ifdef WIN32  
 3590  
 3591         cc = PvmSysErr;
 3592  
 3593         fn = malloc(128 * sizeof(char));
 3594          
   ...
 3650         PVM_FREE(av);
 3651  
 3652         while (stat(sfn, &sb) == -1)
 3653                 Sleep(5000);            /* what a hack */ 
 3654  
 3655 #else 
 3656  
 3657 #ifdef  IMA_TITN 
 3658         if (socketpair(AF_UNIX, SOCK_STREAM, 0, pfd) == -1) 
 3659 #else 
 3660         if (pipe(pfd) == -1)
 3661 #endif 
 3662         {
 3663                 cc = PvmSysErr;
 3664                 goto bail;
 3665         }
 3666  
 3667         fn = pvmgetpvmd();
 3668  
true3669         av = TALLOC(argc + 2, char *, "argv");
 3670         if (argc > 0)
av <= 40873671                 BCOPY((char *)&argv[0], (char *)&av[1], argc * sizeof(char*));     /* Null Pointer Dereference */
Preconditions
$param_1 >= 1
$param_2 != 0
&$unknown_2497110 = 8 * $param_1
&$unknown_2497110 >= 8
pp = 0
pvmmytid != -1
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
pvmtrc.trcopt != 1
pvmtrc.trcopt != 2
pvmtrc.trcopt != 3
rd != 0
td = 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
argc' = $param_1
argv' = $param_2
av' = 0
buf[0]' is checked by path name
errno' != 0
fn' = &$heap_201787
bytes_after(&$heap_201787)' = strlen(rd) + 10
$heap_201787' is allocated by malloc
$heap_201787' is allocated
bytes_before(&$heap_201787)' = 0
newline' = 1
pp' = &$heap_201787
pvm_useruid' != -1
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmtoplvl' = 0
pvmtrccodef' = &pvmtrccodef_nop.enc_byte
sfn' = &buf[0]
td' = &#string21[0]




Change Warning 2837.2898 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: