Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Free Null Pointer  at ddpro.c:2102

Categories: LANG.ALLOC.FNP CWE:590
Warning ID: 2562.2594
Procedure: startack
Trace: View
Modified: Wed Sep 2 12:41:20 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;
buf <= 40952102                         PVM_FREE(buf);     /* Free Null Pointer */
Preconditions
&$unknown_605718 >= 1
((char*)$param_1)[40] >= 0
*$param_1 >= 0
((char*)*$param_1)[72] >= 1
Postconditions
buf' = 0
busyadding' = 0
count' = ((char*)*$param_1)[72]
i' = -1
j' = &$unknown_605718 - 1
mp' = $param_2
wp' = $param_1
wxp' = ((char*)$param_1)[72]




Change Warning 2562.2594 : Free Null Pointer

Priority:
State:
Finding:
Owner:
Note: