diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-10-21 23:57:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-10-21 23:57:05 +0000 |
commit | 13e0065983caec2d9ff5a9f59f3dba4a2569a510 (patch) | |
tree | 9b90b416846cb329ff60a5cc9eef46484376d904 | |
parent | dd71fb5736254f2ce55f82746e8bb3d536f035fd (diff) |
strdup check missing; noted by nimadeus@pandora.be
-rw-r--r-- | usr.bin/tic/tic.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tic/tic.c b/usr.bin/tic/tic.c index cea4446dab4..588a98ac28c 100644 --- a/usr.bin/tic/tic.c +++ b/usr.bin/tic/tic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tic.c,v 1.27 2003/07/02 00:21:16 avsm Exp $ */ +/* $OpenBSD: tic.c,v 1.28 2003/10/21 23:57:04 deraadt Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * @@ -299,8 +299,12 @@ stripped(char *src) while (isspace(CharOf(*src))) src++; if (*src != '\0') { - char *dst = strdup(src); - size_t len = strlen(dst); + char *dst; + size_t len; + + if ((dst = strdup(src)) == NULL) + failed("strdup"); + len = strlen(dst); while (--len != 0 && isspace(CharOf(dst[len]))) dst[len] = '\0'; return dst; |