Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at pvmcruft.c:646

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 403.29115
Procedure: pvmxtoi
Trace: view
Modified: Thu Nov 26 11:34:29 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 pvm_tc_conreq
true1132 pvm_tc_conreq(mid) 
 1133         int mid;
 1134 {
 1135         int src;                                        /* sender of request */ 
 1136         int sbf = 0;                            /* reply message mid */ 
 1137         int ttpro;                                      /* protocol revision */ 
 1138         struct ttpcb *pcbp;                     /* pcb for connection */ 
 1139         int ackd;                                       /* allow connection (0) */ 
 1140         char *addr = "";                        /* socket address */ 
 1141         int i;
 1142         int ictx;
 1143 #ifdef SOCKLENISUINT 
 1144 #if defined(IMA_AIX4SP2) || defined(IMA_AIX5SP2)
 1145         unsigned int oslen;
 1146 #else 
 1147         size_t oslen;
 1148 #endif 
 1149 #else 
 1150         int oslen;
 1151 #endif 
 1152 #ifndef NOUNIXDOM 
 1153         struct sockaddr_un uns;
 1154         char spath[PVMTMPNAMLEN];
 1155 #endif 
 1156         char buf[256];
 1157  
 1158         pvm_bufinfo(mid, (int *)0, (int *)0, &src);
 1159  
 1160         pvm_upkint(&ttpro, 1, 1);
 1161         pvm_upkstr(buf);
 1162  
 1163         if (pcbp = ttpcb_find(src)) {   /* Uninitialized Variable (ID: 406.29119) */
 1164                 if (pvmdebmask & PDMROUTE) {
 1165                         pvmlogprintf( 
 1166                                         "pvm_tc_conreq() crossed CONREQ from t%x\n", src);
 1167                 }
 1168                 if (pcbp->tt_state == TTCONWAIT) {
 1169  
 1170                         /* must handle simultaneous connect from both ends:
 1171                          *  lower tid of the two just ignores the CONREQ.
 1172                          *  higher tid pretends it didn't send a CONREQ,
 1173                          *      sends a CONACK back.
 1174                          * this makes the connection single-sided.
 1175                          */ 
 1176  
 1177                         if (pvmdebmask & PDMROUTE)
 1178                                 pvmlogerror( "pvmmctl() handling crossed CONREQ\n");
 1179  
 1180                         if (pvmmytid > src) {
 1181                                 if (listen(pcbp->tt_fd, 1) == -1)
 1182                                         pvmlogperror("pvm_tc_conreq() listen");
 1183  
 1184                                 else {
 1185                                         pcbp->tt_state = TTGRNWAIT;
 1186                                         pvm_fd_add(pcbp->tt_fd, 1);
 1187                                         ackd = 0;
 1188                                         if (buf[0] == '/') {   /* Uninitialized Variable (ID: 404.29116) */
 1189 #ifdef NOUNIXDOM 
 1190                                                 pvmlogprintf( "%s CONREQ from t%x, ",
 1191                                                                 "pvm_tc_conreq()", src );
 1192                                                 pvmlogprintf(
 1193                                                                 "Unix domain socket unsupported\n" ); 
 1194 #else 
 1195                                                 addr = pcbp->tt_spath;
 1196 #endif 
 1197                                         } else {
buf is uninitialized1198                                                 hex_inadport(buf, &pcbp->tt_osad);
     /kat0/fletcher/SATE/2010/pvm3/src/pvmcruft.c
     Enter pvm_tc_conreq / hex_inadport
 690   hex_inadport(s, sad) 
 691           char *s;
 692           struct sockaddr_in *sad;
 693   {
*s is uninitialized694           sad->sin_addr.s_addr = htonl((unsigned)pvmxtoi(s));   /* Null Pointer Dereference (ID: 129.28750) */
       Enter pvm_tc_conreq / hex_inadport / pvmxtoi
 640     pvmxtoi(p) 
 641             char *p;
 642     {
 643             int i = 0;
 644             char c;
 645      
*p is uninitialized646             if (p[0] == '0' && (p[1] == 'x' || p[1] == 'X'))     /* Uninitialized Variable */  /* 5 more... */
       Exit pvm_tc_conreq / hex_inadport / pvmxtoi
     Exit pvm_tc_conreq / hex_inadport
Preconditions
&$unknown_10812411 != 0
&$unknown_10812414 != $unknown_10812413
&$unknown_10812414 != $unknown_10812414
((char*)$unknown_10812414)[8] <= -3
((char*)$unknown_10812414)[8] <= src - 1
((char*)&$unknown_10812413)[8] <= -3
((char*)&$unknown_10812413)[8] <= src - 1
buf[0] != 47
pvmtoplvl = 0
src <= -2
Postconditions
((char*)$unknown_10812413)[12]' = 2
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
ackd' = 0
addr' = &#string10[0]
i' = 0
newline' = 0
p' = &buf[0]
pcbp' = $unknown_10812413
pvmmytid' = -1
pvmrbuf' = &$unknown_10812411
s' = &buf[0]
sad' = $unknown_10812413 + 36
sbf' = 0
ttlist' = &$unknown_10812414




Change Warning 403.29115 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: