Don't dereference NULL pointer.

This commit is contained in:
mycroft 1993-04-20 09:30:45 +00:00
parent 3f2c883b20
commit 37c185dac7
1 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,7 @@
#ifndef lint
static char sccsid[] = "@(#)dumpoptr.c 5.8 (Berkeley) 3/7/91";
static char rcsid[] = "$Header: /cvsroot/src/sbin/dump/Attic/dumpoptr.c,v 1.3 1993/03/23 00:27:10 cgd Exp $";
static char rcsid[] = "$Header: /cvsroot/src/sbin/dump/Attic/dumpoptr.c,v 1.4 1993/04/20 09:30:45 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -469,10 +469,12 @@ fstabsearch(key)
char *rawname();
for (pf = table; pf != NULL; pf = pf->pf_next) {
char *disk;
fs = pf->pf_fstab;
if (strcmp(fs->fs_file, key) == 0 ||
strcmp(fs->fs_spec, key) == 0 ||
strcmp(rawname(fs->fs_spec), key) == 0)
((disk = rawname(fs->fs_spec)) &&
strcmp(disk, key) == 0))
return (fs);
if (key[0] != '/') {
if (*fs->fs_spec == '/' &&