Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at lpvmgen.c:3997

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2813.2873
Procedure: pvm_archcode
Trace: View
Modified: Wed Sep 2 12:48:01 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/lpvmgen.c
   Enter pvm_archcode
 3945 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);
true3981                                 hlist = TALLOC(nhost, struct pvmhostinfo, "hi");
 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  
 3996                         for ( i=0 ; i < nhost ; i++ ) {   /* Uninitialized Variable (ID: 2815.2875) */
hlist <= 40953997                                 if ( !strcmp(hlist[i].hi_arch, arch) ) {     /* Null Pointer Dereference */  /* Uninitialized Variable (ID: 2814.2874) */
Preconditions
$param_1 != 0
&$unknown_2124465 >= 1
&$unknown_2124473 = 32 * &$unknown_2124491 - 32
&$unknown_2124474 >= 0
&$unknown_2124491 > 128
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid != -1
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
pvmtrc.trcopt <= 3
pvmtrc.trcopt >= 1
Postconditions
((char*)&$unknown_2124473)[16]' = 0
((char*)&$unknown_2124473)[8]' = &$heap_189139
arch' = $param_1
cc' = -32
bytes_after(&$heap_189139)' = &$unknown_2124474
$heap_189139' is allocated by malloc
bytes_before(&$heap_189139)' = 0
hlist' = 0
i' = 0
nhost' = &$unknown_2124491
pvm_errno' = -2
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmtoplvl' = 0
rbf' = -2
sbf' = -2




Change Warning 2813.2873 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: