Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmlog.c:390

Categories: LANG.MEM.NPD CWE:476
Warning ID: 22037.28696
Procedure: vpvmlogprintf
Trace: view
Modified: Thu Nov 26 11:27:28 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;
true1738                 pvmlogprintf(ctime(&time_temp));   /* Format String (ID: 22201.29376) */
     /kat0/fletcher/SATE/2010/pvm3/src/pvmlog.c
     Enter work / pvmlogprintf
 458   pvmlogprintf(const char *fmt, ...) 
 459   #else 
 460   pvmlogprintf(va_alist)
 461           va_dcl 
 462   #endif 
 463   {
 464           va_list ap;
 465           int cc;
 466    
 467   #if defined (__STDC__) || defined(IMA_WIN32_WATCOM)
 468    
 469           va_start(ap, fmt);
 470   #else 
 471           char    *fmt;
 472    
 473           va_start(ap);
 474           fmt = va_arg(ap, char *); 
 475   #endif 
fmt <= 4095476           cc = vpvmlogprintf(fmt, ap);
       Enter work / pvmlogprintf / vpvmlogprintf
 368     vpvmlogprintf(fmt, ap) 
 369             char *fmt;
 370             va_list ap;
 371     {
 372             char vtmp[1024];
 373             char *truncated;
 374             int cnt = 0;
 375             int cc;
 376      
 377     #ifdef  TIMESTAMPLOG 
 378             time_t now;
 379             struct tm *tmp;
 380      
 381             time(&now);
 382             tmp = localtime(&now);
 383     #endif  /*TIMESTAMPLOG*/ 
 384      
 385             /* snag var arg string, in case re-use whacks it... */ 
 386             /* (thank you very much x86_64...  :-Q */ 
 387             /* damn, also need to prevent buffer overflows... */ 
 388             /* (thanks to Lasse Makholm <lasse.makholm@nokia.com> */ 
 389             /* for this patch...) */ 
fmt <= 4095390             cc = vsnprintf(vtmp, sizeof(vtmp), fmt, ap);     /* Null Pointer Dereference */  /* Null Pointer Dereference (ID: 22092.28939) */
       Exit work / pvmlogprintf / vpvmlogprintf
     Exit work / pvmlogprintf
Preconditions
myhostpart != 0
pvmdebmask = 0
Postconditions
ap' = &__builtin_va_alist
ap' = &__builtin_va_alist
atnewline' = 1
strlen(&buf[0])' = 59
buf[59]' = 0
cnt' = 0
errno' != 0
fmt' = 0
fmt' = 0
time_temp' = &$unknown_239667
tmbuf.tm_sec' = &$unknown_239671
tmp' = &tmbuf.tm_sec
tnow.tv_sec' = &$unknown_239667




Change Warning 22037.28696 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: