Keep from dereferencing through a null pointer.
authorGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Fri, 10 Jul 1987 01:38:28 +0000 (17:38 -0800)
committerGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Fri, 10 Jul 1987 01:38:28 +0000 (17:38 -0800)
SCCS-vsn: usr.bin/tn3270/api/astosc.c 1.4

usr/src/usr.bin/tn3270/api/astosc.c

index 1786363..a3ada1e 100644 (file)
@@ -53,7 +53,7 @@ register char *string;
     register struct astosc *this;
 
     for (this = astosc; this <= &astosc[highestof(astosc)]; this++) {
     register struct astosc *this;
 
     for (this = astosc; this <= &astosc[highestof(astosc)]; this++) {
-       if (ustrcmp(this->name, string) == 0) {
+       if ((this->name != 0) && (ustrcmp(this->name, string) == 0)) {
            return this-astosc;
        }
     }
            return this-astosc;
        }
     }