Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at hoster.c:827

Categories: LANG.MEM.NPD CWE:476
Warning ID: 74.28661
Procedure: phase1
Trace: view
Modified: Thu Nov 26 11:27:17 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/hoster.c
   Enter phase1
 770 phase1(sp) 
 771         struct slot *sp;
 772 {
 773         struct hst *hp;
 774         char *hn;
 775         char *av[32];                   /* for rsh args */ 
 776         int ac;
 777         char buf[512];
 778         int pid = -1;                   /* pid of rsh */ 
 779         char *p;
 780  
 781 #ifndef NOREXEC 
 782         struct servent *se;
 783         static u_short execport = 0;
 784  
 785         if (!execport) {
 786                 if (!(se = getservbyname("exec", "tcp"))) {
 787                         pvmlogprintf("phase1() can't getservbyname(): %s\n", "exec");
 788                         pvmbailout(0);
 789                 }
 790                 execport = se->s_port;
 791                 endservent();
 792         }
 793 #endif 
 794  
 795         hp = sp->s_hst;
 796         hn = hp->h_name;
 797         sp->s_rfd = sp->s_wfd = sp->s_efd = -1;
 798  
 799         /*
 800         * XXX manual startup hack... this is if we can't use rexec or rsh 
 801         */ 
 802  
 803         if (hp->h_flag & HST_MANUAL) {
 804                 fprintf(stderr, "*** Manual startup ***\n");
 805                 fprintf(stderr, " to \"%s\" and type:\n", hn);
 806  
 807                 if (hp->h_wincmd) {
 808                         fprintf(stderr, "%s\n\n", hp->h_cmd);
 809                         fprintf(stderr, "or, if that command fails, " );
 810                         fprintf(stderr, "for WIN32 hosts try:\n");
 811                         fprintf(stderr, "%s\n\n", hp->h_wincmd);
 812                 }
 813                 else 
 814                         fprintf(stderr, "%s\n", hp->h_cmd);
 815  
 816         /* get version */ 
 817  
 818                 fprintf(stderr, "Type response: ");
 819                 fflush(stderr);
 820                 if (!(fgets(buf, sizeof(buf), stdin))) {
 821                         pvmlogprintf("host %s read error\n", hn);
 822                         goto oops;
 823                 }
 824                 p = buf + strlen(buf) - 1;
 825                 if (*p == '\n')
 826                         *p = 0;
true827                 hp->h_result = STRALLOC(buf);     /* Null Pointer Dereference */
Preconditions
sp->s_hst->h_wincmd != 0
execport = 0
$input_884 <= 511
$input_884 >= 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
*stdin' is allocated by fopen
bytes_before(stdin)' = 0
SERV_COUNTER' = 0
$unknown_69122' = 0
strlen(&$unknown_69122)' = 0
buf[0]' = $input_892
strlen(&buf[0])' = $input_884
errno' != 0
hn' = sp->s_hst->h_name
hp' = sp->s_hst
p' = &$unknown_69122
pid' = -1
se' = &stored_servent.s_name
stored_servent.s_port' = execport'




Change Warning 74.28661 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: