Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Uninitialized Variable  at ddpro.c:2576

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 2572.2604
Procedure: dm_delhost
Trace: View
Modified: Wed Sep 2 12:41:31 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/ddpro.c
   Enter dm_delhost
true2529 dm_delhost(hp, mp) 
 2530         struct hostd *hp;
 2531         struct pmsg *mp;
 2532 {
 2533         int count;
 2534         char *buf;
 2535         struct pmsg *mp2;               /* DELHOSTACK message */ 
 2536         struct pmsg *mp3;               /* HTDEL message */ 
 2537         struct htab *ht_del;    /* hosts to delete */ 
 2538         struct htab *ht_save;   /* remaining hosts */ 
 2539         int hh;
 2540  
 2541 /* XXX danger, this doesn't check if already doing a host add/delete */ 
 2542  
 2543         /* sanity check count */ 
 2544  
 2545         if (upkint(mp, &count)) {
 2546                 pvmlogerror("dm_delhost() bad msg format\n");
 2547                 return 0;
 2548         }
 2549         if (count < 1 || count > (tidhmask >> (ffs(tidhmask) - 1))) {
 2550                 pvmlogerror("dm_delhost() bad count\n");
 2551                 return 0;
 2552         }
 2553  
 2554         /*
 2555         * read host names from message, generate delete and save sets 
 2556         * and a DELHOSTACK reply message with result code for each host.
 2557         * set SHUTDOWN flag for each host in delete set.
 2558         */ 
 2559  
 2560         ht_del = ht_new(1);   /* Leak (ID: 2568.2600) */
 2561         ht_save = ht_new(1);   /* Leak (ID: 2569.2601) */
 2562         ht_merge(ht_save, hosts);
 2563  
 2564         mp2 = mesg_new(0);
 2565         mp2->m_tag = DM_DELHOSTACK;   /* Null Pointer Dereference (ID: 2574.2606) */
 2566         mp2->m_wid = mp->m_wid;
 2567         mp2->m_dst = mp->m_src;
 2568  
 2569         mp3 = mesg_new(0);
 2570         mp3->m_tag = DM_HTDEL;   /* Null Pointer Dereference (ID: 2573.2605) */
 2571         pkint(mp3, hosts->ht_serial);
 2572  
 2573         pkint(mp2, count);
 2574         while (count-- > 0) {
 2575                 upkstralloc(mp, &buf);
buf is uninitialized2576                 if (hp = nametohost(hosts, buf)) {     /* Uninitialized Variable */
Preconditions
&$unknown_633547 >= 1
&$unknown_633548 = &$unknown_633549 - 136
&$unknown_633549 >= 4232
&$unknown_633556 != 0
hosts->ht_last = 1
((char*)&$heap_37607)[8] >= 0
numpmsgs = 0
Postconditions
((char*)$unknown_633548)[8]' = ((char*)&$unknown_633548)[8]
((char*)$unknown_633550)[8]' = ((char*)&$unknown_633550)[8]
((char*)$unknown_633548)[8]' = $unknown_633548
((char*)$unknown_633550)[8]' = $unknown_633550
$unknown_633549' = &freepmsgs.m_link
((char*)&$unknown_633549)[8]' = ((char*)&$unknown_633548)[8]
$unknown_633550' = &$unknown_633550
((char*)&$unknown_633550)[16]' = 0
((char*)&$unknown_633550)[24]' = 0
((char*)&$unknown_633550)[32]' = 0
((char*)&$unknown_633550)[36]' = 0
((char*)&$unknown_633550)[40]' = 1
((char*)&$unknown_633550)[42]' = 1
((char*)&$unknown_633550)[42]' = 0
((char*)&$unknown_633550)[60]' = 0
((char*)&$unknown_633550)[8]' = &$unknown_633550
count' = &$unknown_633547 - 1
freefrags.fr_link' = &$unknown_633550
freepmsgs.m_link' = &$unknown_633548
freepmsgs.m_rlink' = &$unknown_633548 + 136
$heap_37605' = 0
bytes_after(&$heap_37605)' = 40
$heap_37605' is allocated by malloc
$heap_37605' is allocated
bytes_before(&$heap_37605)' = 0
strlen(&$heap_37605)' = 0
((char*)&$heap_37605)[32]' = &$heap_37606
((char*)&$heap_37605)[4]' = 1
$heap_37606' = 0
bytes_after(&$heap_37606)' = 16
$heap_37606' is allocated by malloc
$heap_37606' is allocated
bytes_before(&$heap_37606)' = 0
strlen(&$heap_37606)' = 0
$heap_37607' = 0
bytes_after(&$heap_37607)' = 40
$heap_37607' is allocated by malloc
$heap_37607' is allocated
bytes_before(&$heap_37607)' = 0
strlen(&$heap_37607)' = 0
hp' = $param_1
ht_del' = &$heap_37605
ht_save' = &$heap_37607
mp' = $param_2
mp2' = &$unknown_633548
mp3' = &$unknown_633548
numpmsgs' = 48




Change Warning 2572.2604 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: