diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-12-16 03:23:03 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-12-16 03:23:03 +0000 |
commit | a6865f81e913763673d816a98287afdbda8f365d (patch) | |
tree | 3153636c01dc8476272a00fe7d783da7f36bfc7a /lib/libtermlib | |
parent | f527d97d86185c7c81a3f99755ae684452b889b9 (diff) |
In tgetstr(), check that the copyout parameter is not NULL or a pointer
to a NULL as required by XPG4.2.
Diffstat (limited to 'lib/libtermlib')
-rw-r--r-- | lib/libtermlib/tgetstr.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libtermlib/tgetstr.c b/lib/libtermlib/tgetstr.c index be832d0e45c..d4a12607612 100644 --- a/lib/libtermlib/tgetstr.c +++ b/lib/libtermlib/tgetstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tgetstr.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ +/* $OpenBSD: tgetstr.c,v 1.2 1997/12/16 03:23:02 millert Exp $ */ /* * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: tgetstr.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; +static char rcsid[] = "$OpenBSD: tgetstr.c,v 1.2 1997/12/16 03:23:02 millert Exp $"; #endif #include <string.h> @@ -43,12 +43,13 @@ tgetstr(entry, area) const char *entry; char **area; { - struct xtoidx *p = _ti_findcap(entry); + struct xtoidx *p; char *s; - if (p != NULL && p->type != TYPE_STR) + if (area == NULL || *area == NULL) return NULL; - if (p == NULL) + p = _ti_findcap(entry); + if (p == NULL || p->type != TYPE_STR) return NULL; if ((s = cur_term->strs[p->idx]) == NULL) return NULL; |