Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at lpvmpack.c:1735

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2818.2878
Procedure: pvmupkstralloc
Trace: View
Modified: Wed Sep 2 12:48:10 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_getmboxinfo
 4631 pvm_getmboxinfo(pattern, nclasses, classes) 
 4632         char *pattern;                                  /* class name */ 
 4633         int *nclasses;                                  /* number of classes returned */ 
 4634         struct pvmmboxinfo **classes;   /* name list returned */ 
 4635 {
 4636         static struct pvmmboxinfo *clist = (struct pvmmboxinfo *) NULL;
 4637         static int nclist = 0;
 4638  
 4639         int sbf, rbf, cc;
 4640         int i, j;
 4641         TEV_DECLS 
 4642  
 4643         if (TEV_EXCLUSIVE) {
 4644                 if (TEV_DO_TRACE(TEV_GETMBOXINFO,TEV_EVENT_ENTRY)) {
 4645                         TEV_PACK_STRING( TEV_DID_CN, TEV_DATA_SCALAR,
 4646                                 pattern ? pattern : "", 1, 1 );
 4647                         TEV_FIN;
 4648                 }
 4649         }
 4650  
 4651         if ( !pattern )
 4652                 pattern = "";
 4653  
 4654         if ( clist ) {
 4655                 for ( i=0 ; i < nclist ; i++ ) {
 4656                         if ( clist[i].mi_name )
 4657                                 PVM_FREE( clist[i].mi_name );
 4658                         if ( clist[i].mi_indices )
 4659                                 PVM_FREE( clist[i].mi_indices );
 4660                         if ( clist[i].mi_owners )
 4661                                 PVM_FREE( clist[i].mi_owners );
 4662                         if ( clist[i].mi_flags )
 4663                                 PVM_FREE( clist[i].mi_flags );
 4664                 }
 4665                 PVM_FREE( clist );
 4666                 clist = (struct pvmmboxinfo *) NULL;
 4667                 nclist = 0;
 4668         }
 4669  
 4670         if ( !(cc = BEATASK) )
 4671         {
 4672                 sbf = pvm_setsbuf( pvm_mkbuf( PvmDataFoo ) );
 4673                 rbf = pvm_setrbuf( 0 );
 4674                 cc = TMDB_NAMES;
 4675                 pvm_pkint( &cc, 1, 1 );
 4676                 pvm_pkint( &pvmmytid, 1, 1 );
 4677                 pvm_pkstr( pattern );
 4678                 cc = 0;
 4679                 pvm_pkint( &cc, 1, 1 );
 4680                 pvm_pkint( &cc, 1, 1 );
 4681                 if ( (cc = msendrecv( TIDPVMD, TM_DB, SYSCTX_TM )) > 0 ) {
 4682                         pvm_upkint( &cc, 1, 1 );
 4683                         if ( cc >= 0 ) {
 4684                                 pvm_upkint( &nclist, 1, 1 );
true4685                                 clist = TALLOC( nclist, struct pvmmboxinfo, "classes" );
clist <= 40954686                                 for ( i=0 ; i < nclist ; i++ ) {
$unknown_12519449 <= 40954687                                         pvmupkstralloc( &(clist[i].mi_name) );
     /u1/paul/SATE/2010/c/pvm/pvm3/src/lpvmpack.c
     Enter pvm_getmboxinfo / pvmupkstralloc
$param_1 <= 40951724   pvmupkstralloc(ss) 
 1725           char **ss;                              /* return pointer */ 
 1726   {
 1727           int cc;
 1728           int l;
 1729    
 1730           if (!pvmrbuf)
 1731                   cc = PvmNoBuf;
 1732           else {
 1733                   if (!(cc = (pvmrbuf->m_codef->dec_int)
 1734                                   (pvmrbuf, (void*)&l, 1, 1, sizeof(int)))) {
ss <= 40951735                           *ss = TALLOC(l, char, "pustr");     /* Null Pointer Dereference */  /* 2 more... */
     Exit pvm_getmboxinfo / pvmupkstralloc
Preconditions
$param_1 != 0
&$unknown_2170627 >= 1
&$unknown_2170628 != 0
&$unknown_2170633 >= 1
&$unknown_2170634 = 1
&$unknown_2170635 = 4
&$unknown_2170636 = 1
nclist >= 2
pvmautoerr != 2
pvmautoerr != 3
pvmmytid = -1
pvmtoplvl != 0
Postconditions
*clist' is freed
cc' >= 0
cc' = 0
classes' = $param_3
clist' = 0
$heap_189361' is allocated by malloc
$heap_189361' is allocated
bytes_before(&$heap_189361)' = 0
i' = 0
l' >= 0
nclasses' = $param_2
nclist' = &$unknown_2170633
pattern' = $param_1
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmrbuf' = &$unknown_2170628
pvmtoplvl' = 0
ss' = 0




Change Warning 2818.2878 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: