Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at lpvmgen.c:4862

Categories: LANG.MEM.NPD CWE:476
Warning ID: 400.29112
Procedure: pvm_unexport
Trace: view
Modified: Thu Nov 26 11:32:56 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/lpvmgen.c
   Enter pvm_unexport
 4836 pvm_unexport(name) 
 4837         char *name;
 4838 {
 4839         char *vn = "PVM_EXPORT";
 4840         char *e, *enew;
 4841         char *p, *q;
 4842         int l;
 4843  
 4844         if (!name[0])
 4845                 goto done;
 4846  
 4847         if (e = getenv(vn)) {
 4848                 p = e;
 4849                 while (*p) {
 4850                         while (*p == ':')
 4851                                 p++;
 4852                         q = p;
 4853                         while (*q && *q != ':')
 4854                                 q++;
 4855                         l = q - p;
 4856                         if (strlen(name) == l && !strncmp(name, p, l)) {
 4857                                 if (*q == ':')
 4858                                         q++;
 4859                                 else if (p > e && *(p - 1) == ':')
 4860                                         p--;
true4861                                 enew = TALLOC(strlen(vn) + (p - e) + strlen(q) + 2, char, "str");
enew <= 40954862                                 strcpy(enew, vn);     /* Null Pointer Dereference */
Preconditions
&$unknown_7585970 <= &$unknown_7585971 - 2
&$unknown_7585970 >= &$heap_373760
*name != 0
strlen(name) >= 1
$unknown_7585970 = 58
strlen(&$unknown_7585970) != strlen(name) + 2
strlen(&$unknown_7585970) > strlen(name) + 2
strlen(&$unknown_7585970) > 3
((char*)&$unknown_7585970)[2] != 0
((char*)&$unknown_7585970)[2] != 58
((char*)&$unknown_7585970)[1] = 58
$unknown_7585971 != 0
$unknown_7585971 != 58
strlen(&$unknown_7585971) = 2
((char*)&$unknown_7585971)[2] = 0
((char*)&$unknown_7585971)[1] != 0
((char*)&$unknown_7585971)[1] != 58
$input_12 >= 1
Postconditions
codesonar_distance_tweak' = 3
e' = &$heap_373760
enew' = 0
errno' != 0
$heap_373760' = 58
bytes_after(&$heap_373760)' = $input_12 + 1
$heap_373760' is allocated by malloc
$heap_373760' is a non-heap object
bytes_before(&$heap_373760)' = 0
strlen(&$heap_373760)' = $input_12
l' = strlen(name)
p' = &$unknown_7585970 + 1
q' = &$unknown_7585971 + 2
vn' = &#string54[0]




Change Warning 400.29112 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: