Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : No Space For Null Terminator  at lpvmgen.c:3119

Categories: MISC.MEM.NTERM CWE:170
Warning ID: 22125.29091
Procedure: pvmgetenvars
Trace: view
Modified: Thu Nov 26 11:31:46 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 pvmgetenvars
$input_12 = 2013098 pvmgetenvars(ep) 
 3099         char ***ep;
 3100 {
 3101         char **xpl;                     /* vars to export */ 
 3102         int mxpl;                       /* cur length of xpl */ 
 3103         int nxpl;                       /* num vars found */ 
 3104         char buf[200];
 3105         char *p, *q;
 3106         int n;
 3107  
 3108         if (p = getenv("PVM_EXPORT")) {
 3109                 mxpl = 5;
 3110                 xpl = TALLOC(mxpl, char *, "env");
 3111                 xpl[0] = p - 11;   /* Null Pointer Dereference (ID: 388.29092) */
 3112                 nxpl = 1;
 3113                 while (1) {
 3114                         while (*p == ':')
strlen(p) = 2013115                                 p++;
 3116                         if (!*p)
 3117                                 break;
strlen(p) = 2003118                         n = (q = CINDEX(p, ':')) ? q - p : strlen(p);
n = 2003119                         strncpy(buf, p, n);     /* No Space For Null Terminator */  /* Buffer Overrun (ID: 386.29090) */
Preconditions
((char*)&$heap_370632)[1] != 0
((char*)&$heap_370632)[1] != 58
$input_12 >= 2
Postconditions
$heap_370632' = 58
bytes_after(&$heap_370632)' = $input_12 + 1
$heap_370632' is allocated by malloc
bytes_before(&$heap_370632)' = 0
strlen(&$heap_370632)' = $input_12
$heap_370633' = &$heap_370632 - 11
bytes_after(&$heap_370633)' = 20
$heap_370633' is allocated by malloc
$heap_370633' is allocated
bytes_before(&$heap_370633)' = 0
mxpl' = 5
n' = $input_12 - 1
nxpl' = 1
p' = &$heap_370632 + 1
q' = 0
xpl' = &$heap_370633




Change Warning 22125.29091 : No Space For Null Terminator

Priority:
State:
Finding:
Owner:
Note: