Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at lpvmgen.c:2505

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2774.2829
Similar Warnings: 2774.2830
Procedure: pvm_notify
Trace: View
Modified: Wed Sep 2 12:46:11 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_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
$param_3 >= 2
&$unknown_1532725 != -1
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid = -1
pvmrescode != 0
pvmtoplvl = 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
cc' = 0
code' = $param_2
count' = $param_3
dosend' = 0
errno' != 0
flags' = $param_1
$heap_173773' = &$unknown_1532713
bytes_after(&$heap_173773)' = 80
$heap_173773' is allocated by malloc
$heap_173773' is allocated
bytes_before(&$heap_173773)' = 0
((char*)&$heap_173773)[16]' <= ((char*)&$unknown_1532713)[16] - 1
((char*)&$heap_173773)[20]' = 8
((char*)&$heap_173773)[24]' = *$param_4
((char*)&$heap_173773)[28]' = *$param_4
((char*)&$heap_173773)[32]' = 0
((char*)&$heap_173773)[56]' = 0
((char*)&$heap_173773)[64]' = 0
((char*)&$heap_173773)[72]' = 0
((char*)&$heap_173773)[8]' = ((char*)&$unknown_1532713)[8]
numtid' = 0
pvm_errno' = -2
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmmytid' = &$unknown_1532725
sbf' = -2
vals' = $param_4
what' = 1
wp' = &$heap_173773




Change Warning 2774.2829 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 2774.2830.

Priority:
State:
Finding:
Owner:
Note: