Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2774.2830
Similar Warnings: 2774.2829
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  
   ...
 2509                                         dosend = 1;
 2510                                 }
 2511                                 break;
 2512  
 2513                         case PvmHostAdd
 2514                                 numtid = 0;
 2515                                 vals = &numtid;
 2516                                 dosend = 1;
 2517                                 break;
 2518  
 2519                         case PvmRouteAdd: 
 2520                                 FORLIST (wp, waitlist, wa_link) 
 2521                                         if (wp->wa_kind == WT_ROUTEA 
 2522                                         && wp->wa_mesg->m_ctx == pvmmyctx 
 2523                                         && wp->wa_mesg->m_tag == code)
 2524                                                 break;
 2525  
 2526                                 if (count == 0 || (flags & PvmNotifyCancel)) {
 2527                                         if (wp != waitlist)
 2528                                                 wait_delete(wp);
 2529  
 2530                                 } else {
 2531                                         if (wp == waitlist) {
 2532                                                 wp = wait_new(WT_ROUTEA);
 2533                                                 wp->wa_tid = pvmmytid;
 2534                                                 wp->wa_on = pvmmytid;
 2535                                                 sbf = pvm_mkbuf(PvmDataFoo);
true2536                                                 wp->wa_mesg = midtobuf(sbf);
wp->wa_mesg <= 40952537                                                 wp->wa_mesg->m_ctx = pvmmyctx;     /* Null Pointer Dereference */
Preconditions
$param_3 != 0
((char*)$unknown_1533424)[20] != 15
*$unknown_1533424 = &$unknown_1533423
$unknown_1533423 != &$unknown_1533423
pvmmytid = -1
pvmrescode = 0
pvmtoplvl != 0
pvmtrc.trctid <= 0
Postconditions
((char*)$unknown_1533423)[8]' = &$heap_173898
((char*)&$unknown_1533423)[8]' = &$heap_173898
cc' = 0
code' = $param_2
count' = $param_3
dosend' = 0
flags' = $param_1
$heap_173898' = &$unknown_1533423
bytes_after(&$heap_173898)' = 80
$heap_173898' is allocated by malloc
$heap_173898' is allocated
bytes_before(&$heap_173898)' = 0
((char*)&$heap_173898)[20]' = 15
((char*)&$heap_173898)[32]' = 0
((char*)&$heap_173898)[56]' = 0
((char*)&$heap_173898)[64]' = 0
((char*)&$heap_173898)[72]' = 0
((char*)&$heap_173898)[8]' = ((char*)&$unknown_1533423)[8]
lastwid' = 1
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmtoplvl' = 0
sbf' = -10
vals' = $param_4
waitlist' = &$unknown_1533423
what' = 4
widbase' <= ((char*)&$unknown_1533423)[16] - 2
widrange' <= lastwid
wp' = &$heap_173898




Change Warning 2774.2830 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 2774.2829.
CodeSonar has selected warning 2774.2829 to represent this group of similar warnings. In order to edit this group, you must edit warning 2774.2829.