Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmcruft.c:598

Categories: LANG.MEM.NPD CWE:476
Warning ID: 117.28737
Procedure: pvmenvinsert
Trace: view
Modified: Thu Nov 26 11:27:40 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/pvmcruft.c
   Enter pvmenvinsert
 575 pvmenvinsert(anep, s) 
 576         char ***anep;           /* environment pointer, may change (NOT environ) */ 
 577         char *s;                        /* string of form "NAME=Value" */ 
 578 {
 579         char **ep;
 580         char **newep;
 581         char *p;
 582         int l;                                          /* length of env var name or env */ 
 583  
 584         newep = *anep;
 585  
 586         if (!s || !(p = CINDEX(s, '=')))
 587                 return -1;
 588         l = p - s + 1;                  /* must include the '=' */ 
 589  
 590         /* search environ for name */ 
 591  
 592         for (ep = newep; *ep; ep++)
 593                 if (!strncmp(*ep, s, l))
 594                         break;
 595  
 596         if (*ep) {                              /* already there, replace it */ 
 597                 PVM_FREE(*ep);
true598                 *ep = STRALLOC(s);     /* Null Pointer Dereference */
Preconditions
&$unknown_396036 != 0
&$unknown_396037 >= *anep
&$unknown_396038 <= strlen(s)
&$unknown_396038 <= strlen(((char*)&$unknown_396037)[4])
&$unknown_396038 >= 1
*s != 61
strlen(s) >= 1
strlen(((char*)&$unknown_396037)[4]) != strlen(s)
strlen(((char*)&$unknown_396037)[4]) >= 1
Postconditions
((char*)$unknown_396037)[4]' is freed
codesonar_distance_tweak' = 3
ep' = &$unknown_396037 + 4
errno' != 0
l' = &$unknown_396038
newep' = *anep
p' = &$unknown_396036




Change Warning 117.28737 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: