🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: demon.ip.developers
Article #1404

Another KA9Q bug in nntpcli.c

#1404
From: Niel Kempson
Date: Sat, 11 Nov 1995 00:00
56 lines
2287 bytes
I've just tracked down another bug in KA9Q's nntpcli.c module.

Symptoms:

    Set up an NNTP server:

        nntp addserver news.demon.co.uk 300

    When the nntp session has been established (headers or articles being
    downloaded), drop the server:
    
        nntp dropserver news.demon.co.uk
        
    At this point, the OS/2 version of KA9Q crashes with a SYS3175 access
    violation inside the strlen() run time library function.  These
    protected mode operating systems double up as useful, ever active
    array bound/null pointer checkers :-)

Explanation:

    Somewhere, strlen() is being called with a NULL pointer, but I didn't
    have enough time to find out where :-( 

Fix:

    Make a small change to the dodrops() function in nntpcli.c to check
    whether a server session is active before trying to drop it.
    
        for (np = Nntpservers; np != NULLNNTP; npprev = np, np = np->next)
        {
            if (stricmp (np->name, argv[1]) == 0)
            {
/* Start of change */
                /*
                ** We must not drop a server if it has an active session in
                ** progress.  Doing so causes an access violation.
                */
                if (!run_timer (&np->nntpcli_t))
                {
                    tprintf("unable to drop server, nntp session active\n");
                    return 0;
                }
/* End of change */

                stop_timer (&np->nntpcli_t);

    
I'm sure I saw a similar report and fix in the last month or so, but I
tried winding back demon.ip.developers to 1 September to find a relevant
message.  No joy.  Sorry if this is a duplicate.

Niel
-- 
Dr C Niel Kempson
Snowy Owl Systems Limited
E-mail: kempson@snowyowl.co.uk (Internet)
Technical Details
Message-ID: <11111995110002um@snowyowl.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bb05,d3c6ec12ed671329,start
X-Google-Attributes: gid10bb05,public
From: Niel Kempson <kempson@snowyowl.co.uk>
Subject: Another KA9Q bug in nntpcli.c
Date: 1995/11/11
Message-ID: <11111995110002um@snowyowl.co.uk>
X-Deja-AN: 119147089
x-broken-date: 11 Nov 1995 11:00 GMT
x-nntp-posting-host: snowyowl.demon.co.uk
organization: Snowy Owl Systems Limited
newsgroups: demon.ip.developers
x-mailer: Umail 1.50i