Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 396.29103
Procedure: pvm_archcode
Trace: view
Modified: Thu Nov 26 11:32:38 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_archcode
true3945 pvm_archcode(arch) 
 3946         char *arch;
 3947 {
 3948         struct pvmhostinfo *hlist;
 3949         int sbf, rbf, cc;
 3950         int nhost, narch;
 3951         int i;
 3952         TEV_DECLS 
 3953  
 3954         if (TEV_EXCLUSIVE) {
 3955                 if (TEV_DO_TRACE(TEV_ARCHCODE,TEV_EVENT_ENTRY)) {
 3956                         TEV_PACK_STRING( TEV_DID_AN, TEV_DATA_SCALAR,
 3957                                 arch ? arch : "", 1, 1 );
 3958                         TEV_FIN;
 3959                 }
 3960         }
 3961  
 3962         if (!arch)
 3963                 cc = PvmBadParam;
 3964  
 3965         else 
 3966         {
 3967                 /* Go get pvm_config() info...  :-Q :-Q :-Q */ 
 3968                 /* (can't use pvm_config() directly, as stomps */ 
 3969                 /* hostinfo structure...  Damn. */ 
 3970  
 3971                 if (!(cc = BEATASK)) {
 3972                         sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
 3973                         rbf = pvm_setrbuf(0);
 3974                         if (pvmschedtid)
 3975                                 cc = msendrecv(pvmschedtid, SM_CONFIG, PvmBaseContext);
 3976                         else 
 3977                                 cc = msendrecv(TIDPVMD, TM_CONFIG, SYSCTX_TM);
 3978                         if (cc > 0) {
 3979                                 pvm_upkint(&nhost, 1, 1);
 3980                                 pvm_upkint(&narch, 1, 1);
 3981                                 hlist = TALLOC(nhost, struct pvmhostinfo, "hi");   /* Integer Overflow of Allocation Size (ID: 22129.29104) */
 3982                                 for (i = 0; i < nhost; i++) {
 3983                                         pvm_upkint(&hlist[i].hi_tid, 1, 1);
 3984                                         pvmupkstralloc(&(hlist[i].hi_name));
 3985                                         pvmupkstralloc(&(hlist[i].hi_arch));
 3986                                         pvm_upkint(&hlist[i].hi_speed, 1, 1);
 3987                                         pvm_upkint(&hlist[i].hi_dsig, 1, 1);
 3988                                 }
 3989                                 pvm_freebuf(pvm_setrbuf(rbf));
 3990                         }
 3991                         pvm_freebuf(pvm_setsbuf(sbf));
 3992                         pvm_setrbuf(rbf);
 3993  
 3994                         cc = PvmNotFound;
 3995  
nhost is uninitialized3996                         for ( i=0 ; i < nhost ; i++ ) {     /* Uninitialized Variable */
Preconditions
arch != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid != -1
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
pvmtrc.trcopt != 2
pvmtrc.trcopt != 3
Postconditions
cc' = -32
i' = 0
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmmidh' = &$unknown_6763375
pvmmidhsiz' >= 2
pvmtoplvl' = 0
pvmtrccodef' = &$unknown_6763351
rbf' = -2
sbf' = -2




Change Warning 396.29103 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: