vncviewer segfault bug (rfbproto.c)

Marcus Brinkmann Marcus.Brinkmann "at" ruhr-uni-bochum.de
Sun, 05 Apr 1998 19:37:36 +0000


On Sun, Apr 05, 1998 at 03:48:03PM +0100, Alan Cox wrote:
> >         }
> >         if (!passwdFile) {
> >             passwd = getpass("Password: ");
> >             if (strlen(passwd) == 0) {
> 
> That code is wrong by inpection incidentally. On some platforms getpass is
> entitled to return NULL in the absence of a controlling terminal.
> >             if (strlen(passwd) > 8) {
> >                 passwd[8] = '\0';
> >             }
> 
> And crypt on many platforms supports over 8 char long passwors

Well, the point is, that this is the actual code in rfbproto.c. The complete
diff is:

flora$ diff rfbproto.c ../../vnc-3.3.1/vncviewer/rfbproto.c
171,172c171,177
<           passwd = vncDecryptPasswdFromFile(passwdFile);
<       } else {
---
>           if ((passwd = vncDecryptPasswdFromFile(passwdFile)) == NULL) {
>                 fprintf (stderr, "%s: couldn't open password file %s\n",
>                       programName, passwdFile);
>                 passwdFile = NULL;
>           }
>         }
>       if (!passwdFile) {

So my diff improves things, but probably not fixes all problems. Note that I
didn't even touched the lines you quote above. The problem I had was that
passwd would still be NULL when the passwd file could not be read for some
reason.

I agree that the problems you mention have probably to be adressed in one or the
other way, though.

Thank you,
Marcus

-- 
"Rhubarb is no Egyptian god."        Debian GNU/Linux        finger brinkmd@ 
Marcus Brinkmann                   http://www.debian.org    master.debian.org
Marcus.Brinkmann "at" ruhr-uni-bochum.de                        for public  PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       PGP Key ID 36E7CD09