Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmd.c:5225

Categories: LANG.MEM.NPD CWE:476
Warning ID: 138.28759
Procedure: varsub
Trace: view
Modified: Thu Nov 26 11:27:45 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/pvmd.c
   Enter varsub
 5205 char * 
 5206 varsub(s) 
 5207         char *s;
 5208 {
 5209         int rm = 8;             /* length of result string space */ 
 5210         char *r;                /* result string */ 
true5211         int rl = 0;
 5212         char *p;
 5213         char *vn, *vv;
 5214         char c;
 5215         int l;
 5216  
 5217         r = TALLOC(rm, char, "var");
 5218         while (*s) {   /* Null Pointer Dereference (ID: 143.28764) */
 5219                 for (p = s; *p && *p != '$'; p++) ;
 5220                 if (l = p - s) {
 5221                         if (rl + l >= rm) {
 5222                                 rm = rl + l + 1;
rl <= 40955223                                 r = TREALLOC(r, rm, char);
 5224                         }
&$unknown_456817 <= 40955225                         strncpy(r + rl, s, l);     /* Null Pointer Dereference */
Preconditions
&$unknown_456820 >= 8
s[1] = 0
*s != 0
*s != 36
strlen(s) = 1
Postconditions
errno' != 0
bytes_after(&$heap_65403)' = 8
$heap_65403' is allocated by malloc
$heap_65403' is allocated
bytes_before(&$heap_65403)' = 0
l' = &$unknown_456820
p' = s + 1
r' = 0
rl' = 0
rm' = &$unknown_456820 + 1




Change Warning 138.28759 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: