Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmcruft.c:380

Categories: LANG.MEM.NPD CWE:476
Warning ID: 22031.28686
Procedure: pvmget32
Trace: view
Modified: Thu Nov 26 11:27:23 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 netinput
 2408 netinput() 
 2409 {
 2410         struct sockaddr_in osad;                /* sender's ip addr */ 
 2411 #ifdef SOCKLENISUINT 
 2412 #if defined(IMA_AIX4SP2) || defined(IMA_AIX5SP2) \
 2413                 || defined(IMA_AIX56K64) || defined(IMA_LINUXALPHA)
 2414         unsigned int oslen;
 2415 #else 
 2416         size_t oslen;
 2417 #endif 
 2418 #else 
   ...
 2429         int src;
 2430         int hh;
 2431         int already;
 2432         struct timeval tdiff;                   /* packet rtt */ 
 2433         int rttusec;
 2434  
 2435         /*
 2436         * alloc new pkt buffer and read packet 
 2437         */ 
 2438  
true2439         pp = pk_new(pvmudpmtu);
 2440         if (TDFRAGHDR > DDFRAGHDR)
 2441                 pp->pk_dat += TDFRAGHDR - DDFRAGHDR;   /* Unreachable Computation (ID: 94.28685) */
 2442  
 2443         oslen = sizeof(osad);
 2444         if ((pp->pk_len = recvfrom(netsock, pp->pk_dat,
 2445                         pp->pk_max - (pp->pk_dat - pp->pk_buf),
 2446                         0, (struct sockaddr*)&osad, &oslen)) == -1) {   /* Null Pointer Dereference (ID: 96.28687) */
 2447                 if (errno != EINTR)
 2448                         pvmlogperror("netinput() recvfrom(netsock)");
 2449                 goto scrap;
 2450         }
 2451  
 2452 #if 0 
 2453         /* drop random packets */ 
 2454         if (!(random() & 3)) {
 2455                 pvmlogerror("netinput() oops, dropped one\n");
 2456                 goto scrap;
 2457         } 
 2458 #endif 
 2459  
 2460 #ifdef  STATISTICS 
 2461         stats.rfok++;
 2462 #endif 
 2463  
pp->pk_dat <= 40952464         cp = pp->pk_dat;
 2465         pp->pk_len -= DDFRAGHDR;
 2466         pp->pk_dat += DDFRAGHDR;
cp <= 40952467         dst = pp->pk_dst = pvmget32(cp);
     /kat0/fletcher/SATE/2010/pvm3/src/pvmcruft.c
     Enter netinput / pvmget32
 374   pvmget32(p) 
 375           char *p;
 376   {
 377           return ((0xff & p[0]) << 24) 
 378           + ((0xff & p[1]) << 16) 
 379           + ((0xff & p[2]) << 8) 
p <= 4095380           + (0xff & p[3]);     /* Null Pointer Dereference */  /* 2 more... */
     Exit netinput / pvmget32
Preconditions
((char*)&$heap_5439)[24] >= 0
netsock >= 0
pvmudpmtu = 0
$input_12 = 0
Postconditions
cp' = 0
$heap_5439' = &$heap_5439
bytes_after(&$heap_5439)' = 120
$heap_5439' is allocated by malloc
$heap_5439' is allocated
bytes_before(&$heap_5439)' = 0
((char*)&$heap_5439)[16]' = 0
((char*)&$heap_5439)[20]' = 16
((char*)&$heap_5439)[28]' = $input_12 - 16
((char*)&$heap_5439)[4]' = &$heap_5439
((char*)&$heap_5439)[8]' = 0
((char*)&$heap_5439)[116]' = 0
((char*)&$heap_5439)[12]' = 0
p' = 0
pp' = &$heap_5439
stats.rfok' = stats.rfok + 1




Change Warning 22031.28686 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: