diff options
author | ru <ru@FreeBSD.org> | 1999-12-29 13:53:13 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 1999-12-29 13:53:13 +0000 |
commit | a40df25abfe506d75d925d8c890834eb094c1172 (patch) | |
tree | f0b0e3e77cf58b0a03dd428c5312d042016a50e3 /sbin | |
parent | 0adde33f2928910064cac5c7d2cd7cc5569b0f9c (diff) | |
download | FreeBSD-src-a40df25abfe506d75d925d8c890834eb094c1172.zip FreeBSD-src-a40df25abfe506d75d925d8c890834eb094c1172.tar.gz |
- do not dereference a null pointer.
- minor sanity.
PR: 15318
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 8a256de..3e1af69 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -609,10 +609,10 @@ ifconfig(argc, argv, afp) } } if (newaddr) { - if (afp->af_ridreq == NULL || afp->af_difaddr == 0) { + if (afp->af_addreq == NULL || afp->af_aifaddr == 0) { warnx("interface %s cannot change %s addresses!", name, afp->af_name); - newaddr = NULL; + newaddr = 0; } } if (newaddr) { @@ -636,6 +636,8 @@ setifaddr(addr, param, s, afp) int s; const struct afswtch *afp; { + if (*afp->af_getaddr == NULL) + return; /* * Delay the ioctl to set the interface addr until flags are all set. * The address interpretation may depend on the flags, @@ -654,6 +656,8 @@ setifnetmask(addr, dummy, s, afp) int s; const struct afswtch *afp; { + if (*afp->af_getaddr == NULL) + return; (*afp->af_getaddr)(addr, MASK); } @@ -694,6 +698,8 @@ setifbroadaddr(addr, dummy, s, afp) int s; const struct afswtch *afp; { + if (*afp->af_getaddr == NULL) + return; (*afp->af_getaddr)(addr, DSTADDR); } @@ -738,6 +744,8 @@ setifdstaddr(addr, param, s, afp) int s; const struct afswtch *afp; { + if (*afp->af_getaddr == NULL) + return; (*afp->af_getaddr)(addr, DSTADDR); } |