Article View: demon.ip.developers
Article #1406KA9Q bug in domain.c
From: Niel Kempson
Date: Sun, 12 Nov 1995 00:00
Date: Sun, 12 Nov 1995 00:00
54 lines
1898 bytes
1898 bytes
I've just tracked down a bug in KA9Q.
Symptoms:
Try to list the dns cache with the command:
domain cache list
At this point, the OS/2 version of KA9Q crashes with a SYS3175 access
violation.
Explanation:
The docachelist() function in domain.c calls newsession() to create a
separate "session window" to display the cache listing.
static int docachelist(int argc, char *argv[], void *p)
{
struct rr *rrp;
struct session *sp;
int row;
if((sp = newsession(argv[1],DCLIST)) == NULLSESSION)
{
return -1;
}
The "dns cache list" command takes no further parameters, so only
argv[0] is defined - argv[1] is undefined/NULL.
Fix:
Pass argv[0] to newsession() instead:
static int docachelist(int argc, char *argv[], void *p)
{
struct rr *rrp;
struct session *sp;
int row;
if((sp = newsession(argv[0],DCLIST)) == NULLSESSION)
{
return -1;
}
This bug hasn't yet crashed the DOS implementation of KA9Q 2.16d in a DOS
session on my machine, but we know that DOS is quite happy to let
programs read NULL pointers.
Niel
--
Dr C Niel Kempson
Snowy Owl Systems Limited
E-mail: kempson@snowyowl.co.uk (Internet)
Technical Details
Message-ID:
<11111995232138um@snowyowl.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bb05,561a3b76a8bde110,start X-Google-Attributes: gid10bb05,public From: Niel Kempson <kempson@snowyowl.co.uk> Subject: KA9Q bug in domain.c Date: 1995/11/12 Message-ID: <11111995232138um@snowyowl.co.uk> X-Deja-AN: 119210875 x-broken-date: 11 Nov 1995 23:21 GMT x-nntp-posting-host: snowyowl.demon.co.uk organization: Snowy Owl Systems Limited newsgroups: demon.ip.developers x-mailer: Umail 1.50i