Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 99.28694
Procedure: work
Trace: view
Modified: Thu Nov 26 11:27:26 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 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),   /* Buffer Overrun (ID: 22089.28936) */  /* Buffer Underrun (ID: 22088.28935) */
 1734                                 myarchname,
 1735                                 PVM_VER);
 1736                 pvmlogprintf("ready ");
 1737                 time_temp = (PVM_TIMET) tnow.tv_sec;
 1738                 pvmlogprintf(ctime(&time_temp));   /* Format String (ID: 22201.29376) */
 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 <= 25
$input_12 >= 0
$input_7964 >= 0
Postconditions
strlen(&buf[0])' = 59
buf[59]' = 0
cmd' = &$heap_7820
ctime_buf[0]' = $input_444
strlen(&ctime_buf[0])' = $input_12
errno' != 0
$heap_7820' = $input_7972
bytes_after(&$heap_7820)' = $input_7964 + 1
$heap_7820' is allocated by malloc
$heap_7820' is a non-heap object
bytes_before(&$heap_7820)' = 0
strlen(&$heap_7820)' = $input_7964
tnow.tv_sec' = time_temp'




Change Warning 99.28694 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: