Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at lpvm.c:2750

Categories: LANG.MEM.NPD CWE:476
Warning ID: 380.29084
Procedure: pvmmcast
Trace: view
Modified: Thu Nov 26 11:31:25 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/lpvm.c
   Enter pvmmcast
 2704 pvmmcast(mid, tids, count, tag) 
 2705         int mid;        
 2706         int *tids;
 2707         int count;
 2708         int tag;
 2709 {
 2710         static struct timeval ztv = { 0, 0 };
 2711  
 2712         int *dst;
 2713         int i, j;
 2714         int cc = 0;
 2715         struct ttpcb *pcbp;
 2716         int sbf;
 2717  
 2718         /*
 2719         * make sorted list of destinations 
 2720         */ 
true2721         dst = TALLOC(count, int, "mcal");   /* Integer Overflow of Allocation Size (ID: 382.29086) */
 2722         BCOPY(tids, dst, count * sizeof(int));   /* Null Pointer Dereference (ID: 381.29085) */  /* Buffer Overrun (ID: 22186.29351) */
 2723  
 2724         qsort( 
 2725                 (void *)dst,  
 2726                 (size_t)count,  
 2727                 sizeof(int),
 2728                 int_compare);
 2729  
 2730         /*
 2731         * remove duplicates 
 2732         */ 
 2733         j = 0;
 2734         for (i = 1; i < count; i++)
 2735                 if (dst[i] != dst[j])
 2736                         dst[++j] = dst[i];
 2737         count = j + 1;
 2738  
 2739         /* Need to set the context of the message buffer */ 
 2740         pvmsbuf->m_ctx = pvmmyctx;
 2741  
 2742         /*
 2743         * remove self from list 
 2744         * send over any direct routes we have 
 2745         *
 2746         * XXX we should attempt new routes here if RouteDirect is on.
 2747         */ 
 2748         j = 0;
 2749         for (i = 0; i < count; i++) {
dst <= 40952750                 if (dst[i] == pvmmytid)     /* Null Pointer Dereference */
Preconditions
count = 0
Postconditions
pvmsbuf->m_ctx' = pvmmyctx
cc' = 0
count' = 1
dst' = 0
errno' != 0
i' = 0
j' = 0




Change Warning 380.29084 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: