Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2563.2595
Procedure: crunchzap
Trace: View
Modified: Wed Sep 2 12:41:21 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/ddpro.c
   Enter startack
 2056 startack(wp, mp) 
 2057         struct waitc *wp;               /* wait context on hoster */ 
 2058         struct pmsg *mp;
 2059 {
 2060         struct hostd *hp;
 2061         struct pmsg *mp2;
 2062         struct waitc *wp2;              /* seed waitc for htupd peer group */ 
 2063         struct waitc *wp3;
 2064         int count;                              /* num of new hosts */ 
 2065         int happy;                              /* num of happy new hosts */ 
 2066         struct waitc_add *wxp;
   ...
 2070         int i, j;
 2071         int t;
 2072         int hh;
 2073         char *buf;
 2074         char buf2[256];
 2075  
 2076         /*
 2077         * unpack startup results, update hosts in wait context 
 2078         */ 
 2079  
 2080         wxp = (struct waitc_add *)wp->wa_spec;
 2081         count = wxp->w_num;
 2082         upkint(mp, &j);
 2083  
 2084         while (j-- > 0) {
true2085                 if (upkuint(mp, &t) || upkstralloc(mp, &buf)) {
 2086                         pvmlogerror("startack() bad message format\n");
 2087                         pkint(wp->wa_mesg, PvmDSysErr);
 2088                         sendmessage(wp->wa_mesg);
 2089                         wp->wa_mesg = 0;
 2090                         wait_delete(wp);
 2091                         busyadding = 0;
 2092                         return 0;
 2093                 }
 2094                 for (i = count; i-- > 0 && wxp->w_hosts[i]->hd_hostpart != t; ) ;
 2095                 if (i < 0) {
 2096                         pvmlogprintf("startack() what? some random tid %x\n", t);
 2097                         pkint(wp->wa_mesg, PvmDSysErr);
 2098                         sendmessage(wp->wa_mesg);
 2099                         wp->wa_mesg = 0;
 2100                         wait_delete(wp);
 2101                         busyadding = 0;
 2102                         PVM_FREE(buf);   /* Free Null Pointer (ID: 2562.2594) */
 2103                         return 0;
 2104                 }
 2105                 hp = wxp->w_hosts[i];
 2106                 ac = sizeof(av)/sizeof(av[0]);
buf <= 40952107                 if (crunchzap(buf, &ac, av) || ac != 5) {
     /u1/paul/SATE/2010/c/pvm/pvm3/src/pvmd.c
     Enter startack / crunchzap
$param_1 <= 40955281   crunchzap(s, acp, av) 
 5282           char *s;                /* the string to parse */ 
 5283           int *acp;               /* max words in, ac out */ 
 5284           char **av;              /* pointers to args */ 
 5285   {
 5286           register int ac;
s <= 40955287           register char *p = s;
 5288           register int n = *acp;
 5289    
 5290           /* separate out words of command */ 
 5291    
 5292           ac = 0;
p <= 40955293           while (*p) {     /* Null Pointer Dereference */
     Exit startack / crunchzap
Preconditions
&$unknown_606279 >= 1
((char*)*$param_1)[72] >= 1
Postconditions
ac' = 0
ac' = 16
acp' = &ac
av' = &av[0]
buf' = 0
count' = ((char*)*$param_1)[72]
i' = ((char*)*$param_1)[72] - 1
j' = &$unknown_606279 - 1
mp' = $param_2
n' = 16
p' = 0
s' = 0
wp' = $param_1
wxp' = ((char*)$param_1)[72]




Change Warning 2563.2595 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: