Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at tdpro.c:1135

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2706.2759
Procedure: tm_spawn
Trace: View
Modified: Wed Sep 2 12:44:06 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/tdpro.c
   Enter tm_spawn
 1083 tm_spawn(tp, mp) 
 1084         struct task *tp;
 1085         struct pmsg *mp;
 1086 {
 1087         char *where = 0;                                /* location from req */ 
 1088         struct waitc *wp;                               /* 'seed' waitc */ 
 1089         struct waitc_spawn *wxp = 0;    /* new task parameters */ 
 1090         struct htab *htp;                               /* set of usable hosts */ 
 1091         struct hostd *hp;
 1092         int hh;
 1093         int i;
 1094         char *wd = 0;
 1095         char *wdenv = 0;
 1096         char *ptr;
 1097         int sz;
 1098  
 1099         /*
 1100         * unpack spawn command from task 
 1101         */ 
 1102  
 1103         wxp = TALLOC(1, struct waitc_spawn, "waix");
 1104         BZERO((char*)wxp, sizeof(struct waitc_spawn));   /* Null Pointer Dereference (ID: 2708.2761) */
 1105  
 1106         if (upkstralloc(mp, &wxp->w_file) 
 1107         || upkint(mp, &wxp->w_flags) 
true1108         || upkstralloc(mp, &where) 
 1109         || upkint(mp, &wxp->w_veclen) 
 1110         || upkint(mp, &wxp->w_argc))
 1111                 goto bad;
 1112  
 1113         if (wxp->w_veclen < 1)
 1114                 goto bad;
 1115  
 1116         wxp->w_argv = TALLOC(wxp->w_argc + 1, char*, "argv");
 1117         BZERO((char*)wxp->w_argv, (wxp->w_argc + 1) * sizeof(char*));   /* Null Pointer Dereference (ID: 2707.2760) */
 1118         for (i = 0; i < wxp->w_argc; i++)
 1119                 if (upkstralloc(mp, &wxp->w_argv[i]))
 1120                         goto bad;
 1121  
 1122         if (upkuint(mp, &wxp->w_outtid) 
 1123         || upkuint(mp, &wxp->w_outctx) 
 1124         || upkuint(mp, &wxp->w_outtag) 
 1125         || upkuint(mp, &wxp->w_trctid) 
 1126         || upkuint(mp, &wxp->w_trcctx) 
 1127         || upkuint(mp, &wxp->w_trctag))
 1128                 goto bad;
 1129  
 1130         /*
 1131         * extract any working directory string from "where"
 1132         */ 
 1133  
where <= 40951134         ptr = where;
ptr <= 40951135         while ( *ptr != ':' && *ptr != '\0' )     /* Null Pointer Dereference */
Preconditions
&$unknown_973289 >= 1
&$unknown_973295 >= 1
&$unknown_973302 >= 1
Postconditions
$heap_160480' = &$heap_160481
bytes_after(&$heap_160480)' = 112
$heap_160480' is allocated by malloc
bytes_before(&$heap_160480)' = 0
strlen(&$heap_160480)' = 0
((char*)&$heap_160480)[16]' = &$heap_160482
((char*)&$heap_160480)[40]' = &$unknown_973302
bytes_after(&$heap_160481)' = &$unknown_973289
$heap_160481' is allocated by malloc
bytes_before(&$heap_160481)' = 0
$heap_160482' = 0
$heap_160482' is allocated by malloc
bytes_before(&$heap_160482)' = 0
strlen(&$heap_160482)' = 0
mp' = $param_2
ptr' = 0
tp' = $param_1
wd' = 0
wdenv' = 0
where' = 0
wxp' = &$heap_160480




Change Warning 2706.2759 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: