Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at ddpro.c:2022

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2551.2582
Procedure: dm_slconf
Trace: View
Modified: Wed Sep 2 12:40:58 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/ddpro.c
   Enter dm_slconf
 1966 dm_slconf(hp, mp) 
 1967         struct hostd *hp;
 1968         struct pmsg *mp;
 1969 {
 1970         int t;                          /* field type */ 
 1971         char *s, *s2;
 1972  
 1973         mp = mp;
 1974         hp = hp;
 1975  
true1976         while (!upkint(mp, &t) && !upkstralloc(mp, &s)) {
 1977                 switch (t) {
 1978  
 1979                 case DM_SLCONF_EP: 
 1980                         if (pvmdebmask & (PDMTASK|PDMSTARTUP)) {
 1981                                 pvmlogprintf("dm_slconf() ep<%s>\n", s);
 1982                         }
 1983                         epaths = colonsep(varsub(s));
 1984                         PVM_FREE(s);
 1985                         break;
 1986  
 1987                 case DM_SLCONF_BP: 
 1988                         if (pvmdebmask & PDMSTARTUP) {
 1989                                 pvmlogprintf("dm_slconf() bp<%s>\n", s);
 1990                         }
 1991                         debugger = varsub(s);
 1992                         PVM_FREE(s);
 1993                         break;
 1994  
 1995                 case DM_SLCONF_WD: 
 1996                         if (pvmdebmask & (PDMTASK|PDMSTARTUP)) {
 1997                                 pvmlogprintf("dm_slconf() wd<%s>\n", s);
 1998                         }
 1999                         s2 = varsub(s);
 2000                         if (chdir(s2) == -1)   /* Null Pointer Dereference (ID: 2552.2583) */
 2001                                 pvmlogperror(s2);
 2002                         PVM_FREE(s);
 2003                         PVM_FREE(s2);
 2004                         break;
 2005  
 2006                 case DM_SLCONF_SCHED: 
 2007                         if (pvmdebmask & (PDMSCHED|PDMSTARTUP)) {
 2008                                 pvmlogprintf("dm_slconf() sched<t%x>\n", pvmschedtid);
 2009                         }
 2010                         pvmschedtid = pvmxtoi(s);
 2011                         break;
 2012  
 2013                 case DM_SLCONF_TRACE: {
 2014                         Pvmtmask tmask;
 2015                         int ttid, tctx, ttag, otid, octx, otag, tbuf, topt;
 2016                         if (pvmdebmask & (PDMTRACE|PDMSTARTUP)) {
 2017                                 pvmlogprintf("dm_slconf() tracer<t%x>\n",
 2018                                         pvmtracer.trctid);
 2019                         }
 2020                         if (sscanf(s, "%x %d %d %x %d %d %d %d %s",
 2021                                         &ttid, &tctx, &ttag, &otid, &octx, &otag,
s <= 40952022                                         &tbuf, &topt, tmask) != 9) {     /* Null Pointer Dereference */
 2023                                 pvmlogprintf("dm_slconf() bogus string<%s>\n", s);
 2024                         }
 2025                         else {
 2026                                 pvmtracer.trctid = ttid;
 2027                                 pvmtracer.trcctx = tctx;
 2028                                 pvmtracer.trctag = ttag;
 2029                                 pvmtracer.outtid = otid;
 2030                                 pvmtracer.outctx = octx;
 2031                                 pvmtracer.outtag = otag;
 2032                                 pvmtracer.trcbuf = tbuf;
 2033                                 pvmtracer.trcopt = topt;
 2034                                 BCOPY(tmask,pvmtracer.tmask,TEV_MASK_LENGTH);
 2035                         }
 2036                         break;
 2037                 }
 2038  
 2039                 default: 
 2040                         pvmlogprintf("dm_slconf() ? type %d val <%s>\n", t, s);
 2041                         PVM_FREE(s);   /* Free Null Pointer (ID: 2555.2586) */
 2042                         break;
Preconditions
&$unknown_484488 >= 1
Postconditions
atnewline' = 0
hp' = $param_1
mp' = $param_2
s' = 0
t' = 5
tmbuf.tm_sec' = &$unknown_484494




Change Warning 2551.2582 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: