Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Buffer Underrun  at lpvmpack.c:1638

Categories: LANG.MEM.BU CWE:124 CWE:127
Warning ID: 2807.2867
Procedure: pvm_pkstr
Trace: View
Modified: Wed Sep 2 12:47:40 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_spawn
 3141 pvm_spawn(file, argv, flags, where, count, tids) 
 3142         char *file;
 3143         char **argv;
 3144         int flags;
 3145         char *where;
 3146         int count;
 3147         int *tids;
 3148 {
 3149         int sbf, rbf;   /* temp for current tx, rx msgs */ 
 3150         int ictx;
 3151         int cc;
 3152         int i, n;
 3153         char **ep;
 3154         int *tidlist = 0;
 3155         char *p;
 3156         char buf[TEV_MASK_LENGTH + 20];
 3157         TEV_DECLS 
 3158  
 3159         if (p = getenv("PVMTASK"))
 3160                 i = pvmstrtoi(p) | flags;
 3161         else 
 3162                 i = flags;
 3163  
 3164         if (TEV_EXCLUSIVE) {
 3165                 if (TEV_DO_TRACE(TEV_SPAWN,TEV_EVENT_ENTRY)) {
 3166                         TEV_PACK_STRING( TEV_DID_SE, TEV_DATA_SCALAR,
 3167                                 file ? file : "", 1, 1 );
 3168                         TEV_PACK_STRING( TEV_DID_SW, TEV_DATA_SCALAR,
 3169                                 where ? where : "", 1, 1 );
 3170                         TEV_PACK_INT( TEV_DID_SF, TEV_DATA_SCALAR, &i, 1, 1 );
 3171                         TEV_PACK_INT( TEV_DID_SC, TEV_DATA_SCALAR, &count, 1, 1 );
 3172                         TEV_FIN;
 3173                 }
 3174         }
 3175  
 3176         if (!(cc = BEATASK)) {
 3177                 if (count < 1)
 3178                         cc = PvmBadParam;
 3179  
 3180                 else {
 3181                         sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
 3182                         rbf = pvm_setrbuf(0);
 3183  
 3184                         pvm_pkstr(file);
 3185                         pvm_pkint(&i, 1, 1);
 3186                         pvm_pkstr(where ? where : "");
 3187                         pvm_pkint(&count, 1, 1);
 3188                         if (argv)
 3189                                 for (n = 0; argv[n]; n++);
 3190                         else 
 3191                                 n = 0;
 3192                         pvm_pkint(&n, 1, 1);
 3193                         for (i = 0; i < n; i++)
 3194                                 pvm_pkstr(argv[i]);   /* Null Pointer Dereference (ID: 2809.2869) */
 3195  
 3196                         pvm_pkint( &(pvmctrc.outtid), 1, 1 );
 3197                         pvm_pkint( &(pvmctrc.outctx), 1, 1 );
 3198                         pvm_pkint( &(pvmctrc.outtag), 1, 1 );
 3199                         pvm_pkint( &(pvmctrc.trctid), 1, 1 );
 3200                         pvm_pkint( &(pvmctrc.trcctx), 1, 1 );
 3201                         pvm_pkint( &(pvmctrc.trctag), 1, 1 );
 3202  
true3203                         n = pvmgetenvars(&ep) + 4;   /* Leak (ID: 2804.2864) */
 3204                         pvm_pkint(&n, 1, 1);
 3205                         n -= 4;
 3206                         sprintf(buf, "PVMTMASK=%s", pvmctrc.tmask);
 3207                         pvm_pkstr(buf);
 3208                         sprintf(buf, "PVMTRCBUF=%d", pvmctrc.trcbuf);
 3209                         pvm_pkstr(buf);
 3210                         sprintf(buf, "PVMTRCOPT=%d", pvmctrc.trcopt);
 3211                         pvm_pkstr(buf);
 3212                         sprintf(buf, "PVMCTX=0x%x", pvmmyctx);
 3213                         pvm_pkstr(buf);
 3214                         if (n > 0) {
bytes_before(*ep) < 03215                                 for (i = 0; i < n; i++)
bytes_before(&$unknown_2009373) < 03216                                         pvm_pkstr(ep[i]);   /* Uninitialized Variable (ID: 2808.2868) */
     /u1/paul/SATE/2010/c/pvm/pvm3/src/lpvmpack.c
     Enter pvm_spawn / pvm_pkstr
bytes_before($param_1) < 01635   pvm_pkstr(cp) 
 1636           char *cp;
 1637   {
bytes_before(cp) < 01638           int l = strlen(cp) + 1;     /* Buffer Underrun */
     Exit pvm_spawn / pvm_pkstr
Preconditions
$param_1 != 0
$param_2 = 0
$param_4 = 0
&$unknown_2009391 >= 1
&$unknown_2009432 = 1
((char*)&$unknown_2009429)[72] != 1073741824
((char*)&$unknown_2009429)[72] != 536870912
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid != -1
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
pvmtrc.trcopt != 1
pvmtrc.trcopt != 2
pvmtrc.trcopt != 3
$input_12 >= 0
$input_168716 = 0
$input_168724 = 0
$input_60 != 48
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
argv' = $param_2
cc' = 0
count' = &$unknown_2009391
cp' = &$heap_188792 - 11
ep' = &$heap_188793
file' = $param_1
flags' = $param_3
$heap_188791' = $input_60
bytes_after(&$heap_188791)' = $input_12 + 1
$heap_188791' is allocated by malloc
$heap_188791' is a non-heap object
bytes_before(&$heap_188791)' = 0
strlen(&$heap_188791)' = $input_12
$heap_188792' = $input_168724
bytes_after(&$heap_188792)' = $input_168716 + 1
$heap_188792' is allocated by malloc
$heap_188792' is a non-heap object
bytes_before(&$heap_188792)' = 0
strlen(&$heap_188792)' = $input_168716
$heap_188793' = &$heap_188792 - 11
bytes_after(&$heap_188793)' = 40
$heap_188793' is allocated by malloc
$heap_188793' is allocated
bytes_before(&$heap_188793)' = 0
i' = 0
n' = &$unknown_2009432
p' = &$heap_188791
pvm_errno' = -2
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmmytid' = -1
pvmsbuf' = &$unknown_2009429
pvmtoplvl' = 0
sbf' = -2
tidlist' = 0
tids' = $param_6
where' = $param_4




Change Warning 2807.2867 : Buffer Underrun

Priority:
State:
Finding:
Owner:
Note: