Re: Calysto v1.5 reports on ssh v4.6p1

This is a discussion on Re: Calysto v1.5 reports on ssh v4.6p1 within the OpenSSH Development forums, part of the Networking and Network Related category; On Sun, Aug 12, 2007 at 11:19:56AM +1000, Darren Tucker wrote: > > choose_dh (dh.c:111) calls ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-12-2007
Peter Stuge
 
Posts: n/a
Default Re: Calysto v1.5 reports on ssh v4.6p1

On Sun, Aug 12, 2007 at 11:19:56AM +1000, Darren Tucker wrote:
> > choose_dh (dh.c:111) calls fopen twice (@120). If the first call
> > to fopen fails (returns NULL), but the second one succeeds, fgets
> > (@129) is called with f==NULL.

>
> I don't follow. If the second call to fopen succeeds, f is a valid
> FILE pointer returned by the second fopen call, not NULL. If both
> fail, the function logs a warning,returns DH group 14 and never
> reaches the fgets.
>
> 120 if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL &&
> 121 (f = fopen(_PATH_DH_PRIMES, "r")) == NULL) {
> 122 logit("WARNING: %s does not exist, using fixed modulus",


I guess the analyzer is concerned with compilers that generate code
to evaluate both statements even though the first one fails. If the
second statement succeeds then it seems to be at least an fd leak.

I don't know what the rules are for C - apparently GCC stops
evaluating once the complete statement is impossible, but is it
good form to rely on that behavior?


//Peter
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/li...enssh-unix-dev
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:51 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0