Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Free Null Pointer  at lpvmgen.c:2143

Categories: ALLOC.FNP CWE:590
Warning ID: 22123.29082
Procedure: pvm_delhosts
Trace: view
Modified: Thu Nov 26 11:31:14 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/lpvmgen.c
   Enter pvm_delhosts
 2097 pvm_delhosts(names, count, svp) 
 2098         char **names;
 2099         int count;
 2100         int *svp;               /* status vector return */ 
 2101 {
 2102         int sbf, rbf;
 2103         int cc;
 2104         int i;
 2105         int *sv;                /* return values */ 
 2106         TEV_DECLS 
 2107  
 2108         if (TEV_EXCLUSIVE) {
 2109                 if (TEV_DO_TRACE(TEV_DELHOSTS,TEV_EVENT_ENTRY)) {
 2110                         TEV_PACK_STRING( TEV_DID_HNL, TEV_DATA_ARRAY,
 2111                                 names, count, 1 );
 2112                         TEV_FIN;
 2113                 }
 2114         }
 2115  
 2116         if (count < 1 || count > (TIDHOST >> (ffs(TIDHOST) - 1))) {
 2117                 cc = PvmBadParam;
 2118  
 2119         } else {
 2120                 if (!(cc = BEATASK)) {
 2121                         sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
 2122                         rbf = pvm_setrbuf(0);
 2123                         pvm_pkint(&count, 1, 1);
 2124                         for (i = 0; i < count; i++)
 2125                                 pvm_pkstr(names[i]);
 2126  
 2127                         if (pvmschedtid)
 2128                                 cc = msendrecv(pvmschedtid, SM_DELHOST, PvmBaseContext);
 2129                         else 
 2130                                 cc = msendrecv(TIDPVMD, TM_DELHOST, SYSCTX_TM);
 2131                         if (cc > 0) {
 2132                                 pvm_upkint(&cc, 1, 1);
 2133                                 if (cc >= 0) {
 2134                                         if (cc == count) {
true2135                                                 sv = TALLOC(count, int, "sv2");   /* Integer Overflow of Allocation Size (ID: 22124.29083) */
 2136                                                 pvm_upkint(sv, count, 1);
 2137                                                 cc = 0;
 2138                                                 for (i = count; i-- > 0; )
 2139                                                         if (sv[i] >= 0)
 2140                                                                 cc++;
 2141                                                 if (svp)
 2142                                                         BCOPY((char*)sv, (char*)svp, count * sizeof(int));
sv <= 40952143                                                 PVM_FREE(sv);     /* Free Null Pointer */
Preconditions
count >= 1
svp != 0
&$unknown_3471570 != 0
&$unknown_3471584 >= 1
&$unknown_3471585 != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid = -1
pvmtoplvl = 0
Postconditions
cc' = 0
count' = 0
errno' != 0
i' = -1
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmrbuf' = &$unknown_3471585
pvmschedtid' = &$unknown_3471570
rbf' = 0
sbf' = -2
sv' = 0




Change Warning 22123.29082 : Free Null Pointer

Priority:
State:
Finding:
Owner:
Note: