Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at lpvmpack.c:1735

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2797.2857
Procedure: pvmupkstralloc
Trace: View
Modified: Wed Sep 2 12:47:08 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
   /u1/paul/SATE/2010/c/pvm/pvm3/src/lpvmgen.c
   Enter pvm_config
 2022 pvm_config(nhostp, narchp, hostp) 
 2023         int *nhostp;
 2024         int *narchp;
 2025         struct pvmhostinfo **hostp;
 2026 {
 2027         int sbf, rbf, cc;
 2028         static int nhost = 0;
 2029         static int narch = 0;
 2030         static struct pvmhostinfo *hlist = 0;
 2031         int i;
 2032         /* char buf[256]; XXX static limit, argh (Not Any More! :-) JAK */ 
 2033         TEV_DECLS 
 2034  
 2035         if (TEV_EXCLUSIVE) {
 2036                 if (TEV_DO_TRACE(TEV_CONFIG,TEV_EVENT_ENTRY))
 2037                         TEV_FIN;
 2038         }
 2039  
 2040         if (hlist) {
 2041                 while (nhost-- > 0) {
 2042                         PVM_FREE(hlist[nhost].hi_name);
 2043                         PVM_FREE(hlist[nhost].hi_arch);
 2044                 }
 2045                 PVM_FREE(hlist);
 2046                 hlist = 0;
 2047                 nhost = 0;
 2048         }
 2049         if (!(cc = BEATASK)) {
 2050                 sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
 2051                 rbf = pvm_setrbuf(0);
 2052                 if (pvmschedtid)
 2053                         cc = msendrecv(pvmschedtid, SM_CONFIG, PvmBaseContext);
 2054                 else 
 2055                         cc = msendrecv(TIDPVMD, TM_CONFIG, SYSCTX_TM);
 2056                 if (cc > 0) {
 2057                         pvm_upkint(&nhost, 1, 1);
 2058                         pvm_upkint(&narch, 1, 1);
true2059                         hlist = TALLOC(nhost, struct pvmhostinfo, "hi");
hlist <= 40792060                         for (i = 0; i < nhost; i++) {
$unknown_10970707 <= 40952061                                 pvm_upkint(&hlist[i].hi_tid, 1, 1);
$unknown_10970745 <= 40952062                                 pvmupkstralloc(&(hlist[i].hi_name));
$unknown_10970767 <= 40952063                                 pvmupkstralloc(&(hlist[i].hi_arch));
     /u1/paul/SATE/2010/c/pvm/pvm3/src/lpvmpack.c
     Enter pvm_config / pvmupkstralloc
$param_1 <= 40951724   pvmupkstralloc(ss) 
 1725           char **ss;                              /* return pointer */ 
 1726   {
 1727           int cc;
 1728           int l;
 1729    
 1730           if (!pvmrbuf)
 1731                   cc = PvmNoBuf;
 1732           else {
 1733                   if (!(cc = (pvmrbuf->m_codef->dec_int)
 1734                                   (pvmrbuf, (void*)&l, 1, 1, sizeof(int)))) {
ss <= 40951735                           *ss = TALLOC(l, char, "pustr");     /* Null Pointer Dereference */  /* 2 more... */
     Exit pvm_config / pvmupkstralloc
Preconditions
&$unknown_1836656 != 0
&$unknown_1836671 >= 1
&$unknown_1836672 != 0
&$unknown_1836675 >= 1
&$unknown_1836680 = 1
&$unknown_1836681 = 4
&$unknown_1836682 = 1
nhost >= 1
pvmmytid != -1
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
pvmtrc.trcopt <= 3
pvmtrc.trcopt >= 1
Postconditions
*hlist' is freed
cc' = 0
cc' = &$unknown_1836671
$heap_186388' is allocated by malloc
$heap_186388' is allocated
bytes_before(&$heap_186388)' = 0
hlist' = 0
hostp' = $param_3
i' = 0
l' >= 0
narchp' = $param_2
nhost' = &$unknown_1836675
nhostp' = $param_1
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmrbuf' = &$unknown_1836672
pvmschedtid' = &$unknown_1836656
pvmtoplvl' = 0
rbf' = -2
ss' = 16




Change Warning 2797.2857 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: