Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at pvmgsu_core.c:770

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 535.29326
Procedure: gs_get_tidlist
Trace: view
Modified: Thu Nov 26 11:37:32 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/pvmgs/pvmgsu_core.c
   Enter gs_get_tidlist
true659 gs_get_tidlist(group, msgtag, ntids, tids, holes_not_allowed) 
 660 char *group;
 661 int msgtag;
 662 int *ntids;  
 663 int **tids;  
 664 int holes_not_allowed;
 665 {
 666         int cc;
 667         int i;
 668         int len;
 669         int rbuf;
 670         int sbuf, state, stid;
 671         int savectx;
 672  
 673         GROUP_STRUCT_PTR sgroup;
 674  
 675         if ( group == (char*)0 || *group == '\0' )  
 676                 return(PvmNullGroup);
 677  
 678         /* look up to see if the information is held locally               */ 
 679  
 680         sgroup = gs_group(group, sgroup_list, &ngroups, NOCREATE);
 681  
 682         if (sgroup != (GROUP_STRUCT_PTR) NULL)  
 683         {
 684                 if (holes_not_allowed)  
 685                 {
 686                         for (i=0; i < sgroup->ntids; i++)
 687                                 if (sgroup->tids[i] == NOTID)
 688                                 {
 689                                         *ntids = -1;
 690                                         return (*ntids);
 691                                 }
 692                 }
   ...
 695  
 696                 for (i = 0; i < sgroup->maxntids; i++)
 697                         (*tids)[i] = sgroup->tids[i];   /* Null Pointer Dereference (ID: 536.29328) */
 698          
 699                 *ntids = sgroup->ntids;
 700  
 701                 return (PvmOk);
 702         }  
 703          
 704         /* find out the server's tid, start the server if need be          */ 
 705         if ( (stid = gs_getgstid()) < 0 )  
 706                 return(PvmSysErr);
 707          
 708         sbuf = pvm_mkbuf(PvmDataDefault);  /* send rqst to server          */ 
 709  
 710         sbuf = pvm_setsbuf(sbuf);
 711  
 712         rbuf = pvm_setrbuf(0);  
 713  
 714         pvm_pkstr(group);
 715  
 716         /* set context for dynamic groups */ 
 717         savectx = pvm_setcontext( SYSCTX_DG );
 718  
 719         if (holes_not_allowed)  
 720         {
 721                 pvm_send(stid, TIDLIST);       /* e.g. scatter, gather         */ 
 722                 cc = pvm_trecv(stid, TIDLIST, pvmgs_tmout);  
 723         }
 724         else 
 725         {
 726                 pvm_send(stid, BCAST);         /* e.g. bcast                   */ 
 727                 cc = pvm_trecv(stid, BCAST, pvmgs_tmout);  
 728         }  
 729  
 730         /* Catch pvmgs timeout... */ 
 731         if ( cc <= 0 )
 732                 return(PvmSysErr);
 733  
 734         /* restore user context */ 
 735         pvm_setcontext( savectx );
 736  
 737         pvm_upkint(ntids, 1, 1);
 738          
 739         if (*ntids < 0) /* check for number of tids in group               */ 
 740         {
 741                 pvm_freebuf(pvm_setsbuf(sbuf));
 742                 pvm_freebuf(pvm_setrbuf(rbuf));
 743  
 744                 return(*ntids);
 745         }
 746          
 747         if (*ntids == 0) /* if there is no one in the group */ 
 748         {
 749                 pvm_freebuf(pvm_setsbuf(sbuf));
 750                 pvm_freebuf(pvm_setrbuf(rbuf));
 751          
 752                 return(PvmNoInst);
 753         }
 754          
 755         /* make room for the tids */ 
 756         *tids = (int *)PVM_ALLOC((*ntids) * sizeof(int), "gs_get_tidlist");   /* Integer Overflow of Allocation Size (ID: 22180.29327) */
 757  
 758         if ((*tids) == (int *) NULL)
 759         {
 760                 pvm_freebuf(pvm_setsbuf(sbuf));
 761                 pvm_freebuf(pvm_setrbuf(rbuf));
 762          
 763                 return(PvmSysErr);
 764         }
 765  
 766         pvm_upkint(*tids, *ntids, 1);
 767  
 768         pvm_upkint(&state,1,1);
 769  
state is uninitialized770         if (state == STATIC)            /* we've got new static group info */     /* Uninitialized Variable */
Preconditions
holes_not_allowed = 0
&$unknown_12727809 >= 1
&$unknown_12727812 >= 1
*group != 0
strlen(group) > 0
gstid >= 0
pvmautoerr = 0
pvmmytid >= -1
pvmtoplvl != 0
Postconditions
cc' = &$unknown_12727809
errno' != 0
bytes_after(&$heap_454228)' = 4 * &$unknown_12727812
$heap_454228' is allocated by malloc
bytes_before(&$heap_454228)' = 0
pvm_errno' = -15
pvmmytid' != -1
pvmrbuf' = 0
pvmtrc.trctid' <= 0
pvmtrccodef' = &$unknown_12727810
rbuf' = -2
sgroup' = 0
stid' = gstid
topvmd' = 0




Change Warning 535.29326 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: