Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at pvmgsu_core.c:1042

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 22185.29343
Procedure: pvm_grpvhostinfo
Trace: view
Modified: Thu Nov 26 11:38:31 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 pvm_grpvhostinfo
 986 pvm_grpvhostinfo(group, coordv, nmem_onhostv, nhosts) 
 987 char *group;
 988 int **coordv, **nmem_onhostv, *nhosts;
 989 {
 990         int foo;
 991         int info;
 992         int rbuf, rc;
 993         int sbuf, state, stid;
 994         int x;
 995         int savectx;
 996  
 997         GROUP_STRUCT_PTR sgroup;
 998  
 999         /* BGN_TRACE( TEV_GRPVHOST, group, TEV_DID_HPT, &hosttid ); */ 
 1000  
 1001         info = gs_host_all(group, sgroup_list, &ngroups,  
 1002                         coordv, nmem_onhostv, nhosts, &foo);  
 1003  
 1004         if (info  != PvmOk )   /* info not local */ 
 1005         {
 1006                 if ( (stid = gs_getgstid()) < 0) { /* find the server's ti */ 
 1007                         info = PvmSysErr;
 1008                         /* END_TRACE( TEV_GRPHOST, TEV_DID_CC, &info ); */ 
 1009                         return( info );
 1010                 }
 1011  
 1012                 /* set context for dynamic groups */ 
 1013                 savectx = pvm_setcontext( SYSCTX_DG );
 1014  
 1015                 sbuf = pvm_mkbuf(PvmDataDefault);
 1016  
 1017                 rbuf = pvm_setrbuf(0);
 1018  
 1019                 sbuf = pvm_setsbuf(sbuf);  
 1020  
 1021                 if ((info = pvm_pkstr(group)) < 0)  
 1022                         goto cleanup;
 1023  
 1024                 if ((info = pvm_send(stid,HOSTCHARV)) < 0)  
 1025                         goto cleanup;
 1026  
 1027                 if ((info = pvm_trecv(stid,HOSTCHARV,pvmgs_tmout)) <= 0)  
 1028                         goto cleanup;
 1029  
 1030                 if ((info = pvm_upkint(nhosts,1,1)) < 0)  
 1031                         goto cleanup;
 1032  
 1033                 if (*nhosts >  gsu_maxhosts)
 1034                 {
 1035                         if (gsu_coordv)  
 1036                                 PVM_FREE(gsu_coordv);
 1037  
 1038                         if (gsu_onhostv)  
 1039                                 PVM_FREE(gsu_onhostv);
 1040  
 1041                         gsu_coordv = (int *) PVM_ALLOC(*nhosts*sizeof(int),  
true1042                                         "pvm_grp_hostv");     /* Integer Overflow of Allocation Size */
Preconditions
&$unknown_13575970 >= 1
&$unknown_13575971 != 0
group[1] = 0
*group != 0
strlen(group) = 1
gstid >= 0
gsu_coordv != 0
gsu_onhostv != 0
pvmtoplvl != 0
$input_12 = 0
Postconditions
*gsu_coordv' is freed
*gsu_onhostv' is freed
foo' = 2
info' = 0
pvmrbuf' = &$unknown_13575971
rbuf' = -2
stid' = gstid




Change Warning 22185.29343 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: