Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at ddpro.c:914

Categories: LANG.MEM.NPD CWE:476
Warning ID: 22053.28724
Procedure: addhosts
Trace: view
Modified: Thu Nov 26 11:27:36 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/ddpro.c
   Enter addhosts
 840 addhosts(mp, rmp) 
 841         struct pmsg *mp;        /* the request message */ 
 842         struct pmsg *rmp;       /* reply message blank */ 
 843 {
 844         struct hostd *hp, *hp2;
 845         struct pmsg *mp2;
 846         struct waitc *wp = 0;
 847         struct waitc_add *wxp = 0;
 848         int i, j;
 849         int count;
 850         int ngood;
 851         int ntid;
 852         struct hostent *he;
 853         int maxhostid = (tidhmask >> ffs(tidhmask) - 1);
 854         int hh;
 855         int pid;
 856         int *tids;
 857         char *winpvmdpath;
 858         char *pvmdpath;
 859         char *vmid;
 860         char *buf;
 861         int len;
 862  
 863         /*
 864         * have to lock this for 2 reasons:
 865         *  1. system can't handle overlapping host table updates,
 866         *  2. the new host tids aren't reserved 
 867         */ 
 868         if (busyadding) {
 869 /*
 870                 pvmlogerror("addhosts() already adding new hosts\n");
 871 */ 
 872                 pkint(rmp, PvmAlready);
 873                 sendmessage(rmp);
 874                 return 0;
 875         }
 876  
 877         busyadding = 1;
 878  
 879         /* sanity check count */ 
 880  
 881         if (upkint(mp, &count) || count < 1 || count > maxhostid) {
 882                 pvmlogerror("addhosts() bad msg format\n");
 883                 goto bad;
 884         }
 885  
 886         /*
 887         * make wait context, extract host list from message,
 888         */ 
 889  
 890         wp = wait_new(WT_HOSTSTART);
 891         wp->wa_tid = mp->m_src;
 892         wp->wa_dep = mp->m_wid;
 893         wxp = TALLOC(1, struct waitc_add, "waix");
 894         wxp->w_num = count;   /* Null Pointer Dereference (ID: 22059.28730) */
 895         wxp->w_hosts = TALLOC(count, struct hostd *, "waiv");   /* Integer Overflow of Allocation Size (ID: 22058.28729) */
 896         BZERO((char*)wxp->w_hosts, count * sizeof(struct hostd *));   /* Null Pointer Dereference (ID: 22057.28728) */
 897         wp->wa_spec = (void *)wxp;
 898  
 899         for (i = 0; i < count; i++) {
true900                 hp = hd_new(0);
 901                 wxp->w_hosts[i] = hp;
 902                 if (upkstralloc(mp, &buf)) {
 903                         pvmlogerror("addhosts() bad msg format\n");
 904                         goto bad;
 905                 }
 906                 if (parsehost(buf, hp)) {
 907                         hp->hd_err = PvmBadParam;   /* Null Pointer Dereference (ID: 22054.28725) */
 908  
 909                 } else {
 910  
 911                 /* Set unspecified fields from hostfile if available */ 
 912  
 913                         if (filehosts &&
hp <= 4095914                                         ((hp2 = nametohost(filehosts, hp->hd_name))     /* Null Pointer Dereference */
Preconditions
&$unknown_372775 >= 1
&$unknown_372776 >= 1
busyadding = 0
filehosts != 0
$heap_56475 != 0
strlen(&$heap_56475) != 0
Postconditions
buf' = &$heap_56475
busyadding' = 1
count' = &$unknown_372775
bytes_after(&$heap_56472)' = 48
$heap_56472' is allocated by malloc
$heap_56472' is allocated
bytes_before(&$heap_56472)' = 0
((char*)&$heap_56472)[16]' = 0
((char*)&$heap_56472)[36]' = 0
((char*)&$heap_56472)[40]' = 0
((char*)&$heap_56472)[44]' = &$heap_56473
((char*)&$heap_56472)[12]' = 3
$heap_56473' = &$unknown_372775
bytes_after(&$heap_56473)' = 8
$heap_56473' is allocated by malloc
$heap_56473' is allocated
bytes_before(&$heap_56473)' = 0
((char*)&$heap_56473)[4]' = &$heap_56474
$heap_56474' = 0
bytes_after(&$heap_56474)' = 4 * &$unknown_372775
$heap_56474' is allocated by malloc
$heap_56474' is allocated
bytes_before(&$heap_56474)' = 0
bytes_after(&$heap_56475)' = &$unknown_372776
$heap_56475' is allocated by malloc
bytes_before(&$heap_56475)' = 0
hp' = 0
i' = 0
maxhostid' >= 1
maxhostid' >= &$unknown_372775
wp' = &$heap_56472
wxp' = &$heap_56473




Change Warning 22053.28724 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: