Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at lpvmgen.c:2505

Categories: LANG.MEM.NPD CWE:476
Warning ID: 360.29046
Procedure: pvm_notify
Trace: view
Modified: Thu Nov 26 11:30: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/src/lpvmgen.c
   Enter pvm_notify
 2439 pvm_notify(what, code, count, vals) 
 2440         int what;
 2441         int code;
 2442         int count;
 2443         int *vals;
 2444 {
 2445         static struct timeval ztv = { 0, 0 };
 2446  
 2447         int sbf;
 2448         int cc;
 2449         int numtid;
 2450         int dosend = 0;
 2451         struct waitc *wp;
 2452         int flags;
 2453         TEV_DECLS 
 2454  
 2455         if (TEV_EXCLUSIVE) {
 2456                 if (TEV_DO_TRACE(TEV_NOTIFY,TEV_EVENT_ENTRY)) {
 2457                         int tevcount;
 2458                         TEV_PACK_INT( TEV_DID_NE, TEV_DATA_SCALAR, &what, 1, 1 );
 2459                         TEV_PACK_INT( TEV_DID_NMC, TEV_DATA_SCALAR, &code, 1, 1 );
 2460                         tevcount = ( what != PvmHostAdd ) ? count : 0;
 2461                         TEV_PACK_INT( TEV_DID_NTL, TEV_DATA_ARRAY,
 2462                                 vals, tevcount, 1 );
 2463                         TEV_FIN;
 2464                 }
 2465         }
 2466  
 2467         flags = what;
 2468         what &= ~PvmNotifyCancel;
 2469  
 2470         if (!(cc = BEATASK)) {
 2471                 if (!pvmrescode && (code & ~0x7fffffff)) {
 2472                         cc = PvmBadParam;
 2473  
 2474                 } else {
 2475                         switch (what) {
 2476  
 2477                         case PvmHostDelete: 
 2478                                 if (count < 1)
 2479                                         cc = PvmBadParam;
 2480                                 else {
 2481                                         numtid = count;
 2482                                         dosend = 1;
 2483                                 }
 2484                                 break;
 2485  
 2486                         case PvmTaskExit: 
 2487                                 if (count < 1)
 2488                                         cc = PvmBadParam;
 2489                                 else 
 2490                                         for (numtid = count; numtid-- > 0; )
 2491                                                 if (!TIDISTASK(vals[numtid])) {
 2492                                                         cc = PvmBadParam;
 2493                                                         break;
 2494                                                 }
 2495                                 if (!cc) {
 2496                                         for (numtid = count; numtid-- > 0; )
 2497                                                 if (vals[numtid] == pvmmytid) {
 2498                                                         wp = wait_new(WT_TASKX);
 2499                                                         wp->wa_tid = pvmmytid;
 2500                                                         wp->wa_on = pvmmytid;
 2501                                                         sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
 2502                                                         pvm_pkint(&pvmmytid, 1, 1);
 2503                                                         sbf = pvm_setsbuf(sbf);
true2504                                                         wp->wa_mesg = midtobuf(sbf);
wp->wa_mesg <= 40952505                                                         wp->wa_mesg->m_ctx = pvmmyctx;     /* Null Pointer Dereference */
 2506                                                         wp->wa_mesg->m_tag = code;
Preconditions
count >= 2
pvmmytid != -1
pvmrescode = 0
pvmtoplvl = 0
Postconditions
cc' = 0
dosend' = 0
flags' = what
bytes_after(&$heap_348992)' = 48
$heap_348992' is allocated by malloc
$heap_348992' is allocated
bytes_before(&$heap_348992)' = 0
((char*)&$heap_348992)[16]' = *vals
((char*)&$heap_348992)[20]' = *vals
((char*)&$heap_348992)[24]' = 0
((char*)&$heap_348992)[28]' = &$heap_348992
((char*)&$heap_348992)[32]' = &$heap_348992
((char*)&$heap_348992)[36]' = 0
((char*)&$heap_348992)[40]' = 0
((char*)&$heap_348992)[44]' = 0
((char*)&$heap_348992)[12]' = 8
numtid' = 0
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
sbf' <= 0
what' = 1
wp' = &$heap_348992




Change Warning 360.29046 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: