Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2504.2534
Procedure: work
Trace: View
Modified: Wed Sep 2 12:39:55 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 work
 1696 work() 
 1697 {
 1698         static int lastpinged = 0;      /* host that got last keepalive msg */ 
 1699 #ifdef FDSETNOTSTRUCT 
 1700         fd_set rfds, wfds;                      /* result of select */ 
 1701         /* fd_set efds; */ 
 1702 #else 
 1703         struct fd_set rfds, wfds;       /* result of select */ 
 1704         /* struct fd_set efds; */ 
 1705 #endif 
 1706         int nrdy;                                       /* number of fds ready after select */ 
   ...
 1718         double tbpl;                            /* time at beginning of probe loop */ 
 1719         double toutpl;                          /* timeout in the probe loop */ 
 1720         int timed_out;
 1721         extern double dclock();
 1722 #endif 
 1723 #endif 
 1724 #ifdef  SHMEM 
 1725         int someclosed; 
 1726 #endif 
 1727  
 1728         gettimeofday(&tnow, (struct timezone*)0);
 1729         if (pvmdebmask || myhostpart) {
 1730                 PVM_TIMET time_temp;
 1731                 pvmlogprintf("%s (%s) %s %s\n",
 1732                                 hosts->ht_hosts[hosts->ht_local]->hd_name,
 1733                                 inadport_decimal(&hosts->ht_hosts[hosts->ht_local]->hd_sad),
 1734                                 myarchname,
 1735                                 PVM_VER);
 1736                 pvmlogprintf("ready ");
 1737                 time_temp = (PVM_TIMET) tnow.tv_sec;
 1738                 pvmlogprintf(ctime(&time_temp));
 1739         }
 1740  
 1741         /*
 1742         * check for default plug-in modules (& start them)
 1743         * (only if pvmd, not for pvmd'...)
 1744         */ 
 1745  
 1746         if ( myhostpart ) {
 1747                 char *av[5];
 1748                 char *buf;
 1749                 char *cmd;
 1750                 int ac;
 1751                 int i;
 1752  
 1753                 for ( i=0 ; modulenames[i] ; i++ ) {
 1754                         cmd = getenv( modulenames[i] );
 1755                         if ( cmd != NULL )
 1756                         {
true1757                                 buf = STRALLOC( cmd );     /* Null Pointer Dereference */
 1758                                 ac = sizeof(av)/sizeof(av[0]);
 1759                                 if (!buf || acav( buf, &ac, av )) {
 1760                                         pvmlogprintf( "$%s: Line Too Long \"%s\".\n",
 1761                                                         modulenames[i], cmd );
 1762                                 } else {
 1763                                         av[ ac ] = (char *) NULL;
 1764                                         locl_spawn( av[0], av + 1 );
 1765                                 }
 1766                                 if (buf) PVM_FREE( buf );
Preconditions
myhostpart != 0
pvmdebmask != 0
$input_12 >= 0
Postconditions
cmd' = &$heap_5718
$heap_5718' = $input_60
bytes_after(&$heap_5718)' = $input_12 + 1
$heap_5718' is allocated by malloc
$heap_5718' is a non-heap object
bytes_before(&$heap_5718)' = 0
strlen(&$heap_5718)' = $input_12
time_temp' = &$unknown_250743
tnow.tv_sec' = &$unknown_250743




Change Warning 2504.2534 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: