Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at tdpro.c:2105

Categories: LANG.MEM.NPD CWE:476
Warning ID: 306.28983
Procedure: tm_notify
Trace: view
Modified: Thu Nov 26 11:29:22 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/tdpro.c
   Enter tm_notify
 1948 tm_notify(tp, mp) 
 1949         struct task *tp;
 1950         struct pmsg *mp;
 1951 {
 1952         int what, flags, ctx, tag, count, tid;
 1953         struct hostd *hp;
 1954         struct pmsg *mp2;
 1955         struct waitc *wp;
 1956         int i;
 1957  
 1958         if (upkint(mp, &what) 
 1959         || upkint(mp, &ctx) 
 1960         || upkint(mp, &tag) 
 1961         || upkint(mp, &count)) {
 1962                 pvmlogerror("tm_notify() bad msg format\n");
 1963                 return 0;
 1964         }
 1965  
 1966         flags = what;
 1967         what &= 0xff;
 1968         switch (what) {
 1969  
 1970         /*
 1971         * TaskExit: make a wait context that hangs out until the task is 
 1972         * cleaned up.
 1973         */ 
 1974  
 1975         case PvmTaskExit: 
 1976                 for (i = 0; i < count; i++) {
 1977                         if (upkuint(mp, &tid)) {
 1978                                 pvmlogerror("tm_notify() bad msg format\n");
   ...
 2073                                         wp->wa_on = hp->hd_hostpart;
 2074                                         wp->wa_mesg = mp2;
 2075  
 2076                                 } else {
 2077                                         sendmessage(mp2);
 2078                                 }
 2079                         }
 2080                 }
 2081                 break;
 2082  
 2083         case PvmHostAdd: 
 2084  
 2085                 FORLIST (wp, waitlist, wa_link) 
 2086                         if (wp->wa_kind == WT_HOSTA 
 2087                         && wp->wa_tid == tp->t_tid 
 2088                         && wp->wa_mesg->m_ctx == ctx 
 2089                         && wp->wa_mesg->m_tag == tag)
 2090                                 break;
 2091  
 2092         /* if cancelling, delete possible existing waitc */ 
 2093  
 2094                 if (count == 0 || (flags & PvmNotifyCancel)) {
 2095                         if (wp != waitlist)
 2096                                 wait_delete(wp);
 2097  
 2098         /* otherwise, update existing waitc or create new one */ 
 2099                 } else {
 2100                         if (wp == waitlist) {
 2101                                 wp = wait_new(WT_HOSTA);
 2102                                 wp->wa_tid = tp->t_tid;
 2103                                 wp->wa_on = tp->t_tid;
true2104                                 wp->wa_mesg = mesg_new(0);
wp->wa_mesg <= 40952105                                 wp->wa_mesg->m_dst = tp->t_tid;     /* Null Pointer Dereference */
Preconditions
&$unknown_1018505 != 0
waitlist->wa_link != waitlist
numpmsgs = 0
Postconditions
count' = &$unknown_1018505
errno' != 0
freepmsgs.m_link' = &freepmsgs.m_link
freepmsgs.m_rlink' = &freepmsgs.m_link
bytes_after(&$heap_334306)' = 48
$heap_334306' is allocated by malloc
$heap_334306' is allocated
bytes_before(&$heap_334306)' = 0
((char*)&$heap_334306)[16]' = tp->t_tid
((char*)&$heap_334306)[20]' = tp->t_tid
((char*)&$heap_334306)[24]' = 0
((char*)&$heap_334306)[28]' = &$heap_334306
((char*)&$heap_334306)[32]' = &$heap_334306
((char*)&$heap_334306)[36]' = 0
((char*)&$heap_334306)[40]' = 0
((char*)&$heap_334306)[44]' = 0
((char*)&$heap_334306)[12]' = 12
what' = 3
wp' = &$heap_334306




Change Warning 306.28983 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: