Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at lpvmgen.c:3216

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 390.29094
Procedure: pvm_spawn
Trace: view
Modified: Thu Nov 26 11:31:54 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/src/lpvmgen.c
   Enter pvm_spawn
true3141 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: 391.29095) */
 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  
 3203                         n = pvmgetenvars(&ep) + 4;   /* Leak (ID: 389.29093) */
 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) {
 3215                                 for (i = 0; i < n; i++)
ep is uninitialized3216                                         pvm_pkstr(ep[i]);     /* Uninitialized Variable */
Preconditions
count >= 1
&$unknown_4958165 >= 3
((char*)&$unknown_4958164)[52] != 1073741824
((char*)&$unknown_4958164)[52] != 536870912
((char*)&$heap_370930)[1] <= 120
((char*)&$heap_370930)[1] >= 48
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid = -1
pvmtoplvl != 0
$input_12 >= 1
$input_444 = 48
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
strlen(&buf[0])' = 17
buf[17]' = 0
buf[21]' = 0
cc' = 0
$heap_370930' = $input_444
bytes_after(&$heap_370930)' = $input_12 + 1
$heap_370930' is allocated by malloc
$heap_370930' is a non-heap object
bytes_before(&$heap_370930)' = 0
strlen(&$heap_370930)' = $input_12
i' = &$unknown_4958165 - 2
n' = &$unknown_4958165
p' = &$heap_370930
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
strlen(&pvmctrc.trctid)' >= 23
pvmsbuf' = &$unknown_4958164
pvmtoplvl' = 0
rbf' = 0
sbf' = -2
tidlist' = 0




Change Warning 390.29094 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: