From b9a8a81041d75fd2f18a80da77ef21a9b9ea5394 Mon Sep 17 00:00:00 2001 From: dd Date: Wed, 2 Oct 2002 02:17:59 +0000 Subject: Don't crash when the user feeds us nonesense in the form: ifconfig IF ether WHATEVER -alias PR: 42544 Submitted by: Mike Makonnen --- sbin/ifconfig/ifconfig.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sbin') diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 35ac555..49ae26b 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -965,9 +965,10 @@ void notealias(const char *addr, int param, int s, const struct afswtch *afp) { if (setaddr && doalias == 0 && param < 0) - bcopy((caddr_t)rqtosa(af_addreq), - (caddr_t)rqtosa(af_ridreq), - rqtosa(af_addreq)->sa_len); + if (afp->af_addreq != NULL && afp->af_ridreq != NULL) + bcopy((caddr_t)rqtosa(af_addreq), + (caddr_t)rqtosa(af_ridreq), + rqtosa(af_addreq)->sa_len); doalias = param; if (param < 0) { clearaddr = 1; -- cgit v1.1