Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at lpvmgen.c:1982

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 378.29077
Procedure: pvm_addhosts
Trace: view
Modified: Thu Nov 26 11:31:05 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_addhosts
true1936 pvm_addhosts(names, count, svp) 
 1937         char **names;   /* host name vector */ 
 1938         int count;              /* length of names */ 
 1939         int *svp;               /* status vector return */ 
 1940 {
 1941         int sbf, rbf;
 1942         int cc;
 1943         int i;
 1944         int *sv;                /* status vector */ 
 1945         char *buf;
 1946         int tmp;
 1947         TEV_DECLS 
 1948  
 1949         if (TEV_EXCLUSIVE) {
 1950                 if (TEV_DO_TRACE(TEV_ADDHOSTS,TEV_EVENT_ENTRY)) {
 1951                         TEV_PACK_STRING( TEV_DID_HNL, TEV_DATA_ARRAY,
 1952                                 names, count, 1 );
 1953                         TEV_FIN;
 1954                 }
 1955         }
 1956  
 1957         if (count < 1 || count > (TIDHOST >> (ffs(TIDHOST) - 1))) {
 1958                 cc = PvmBadParam;
 1959  
 1960         } else {
 1961                 if (!(cc = BEATASK)) {
 1962                         sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
 1963                         rbf = pvm_setrbuf(0);
 1964                         pvm_pkint(&count, 1, 1);
 1965                         for (i = 0; i < count; i++)
 1966                                 pvm_pkstr(names[i]);
 1967  
 1968                         if (pvmschedtid)
 1969                                 cc = msendrecv(pvmschedtid, SM_ADDHOST, PvmBaseContext);
 1970                         else 
 1971                                 cc = msendrecv(TIDPVMD, TM_ADDHOST, SYSCTX_TM);
 1972                         if (cc > 0) {
 1973                                 pvm_upkint(&cc, 1, 1);
 1974                                 if (cc >= 0) {
 1975                                         if (cc == count) {
 1976                                                 pvm_upkint(&cc, 1, 1);  /* toss narches */ 
 1977                                                 sv = TALLOC(count, int, "sv1");   /* Integer Overflow of Allocation Size (ID: 22119.29078) */
 1978                                                 cc = 0;
 1979                                                 for (i = 0; i < count; i++) {
 1980                                                         pvm_upkint(&sv[i], 1, 1);
 1981                                                         /* toss name, arch, speed, ds */ 
buf is uninitialized1982                                                         pvmupkstralloc(&buf);   PVM_FREE(buf);     /* Uninitialized Variable */  /* Free Null Pointer (ID: 22117.29076) */
Preconditions
count >= 2
&$unknown_3209546 != 0
&$unknown_3209557 >= 1
&$unknown_3209558 != 0
&$unknown_3209560 != 0
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid != -1
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
pvmtrc.trcopt != 1
pvmtrc.trcopt != 2
pvmtrc.trcopt != 3
Postconditions
cc' = 0
bytes_after(&$heap_370062)' = 4 * count
$heap_370062' is allocated by malloc
bytes_before(&$heap_370062)' = 0
i' = 0
pvm_errno' = -2
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmmytid' != -1
pvmrbuf' = &$unknown_3209558
pvmschedtid' = &$unknown_3209546
pvmtoplvl' = 0
pvmtrccodef' = &pvmtrccodef_nop.enc_byte
sbf' = -2
sv' = &$heap_370062




Change Warning 378.29077 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: