From 13e0065983caec2d9ff5a9f59f3dba4a2569a510 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 21 Oct 2003 23:57:05 +0000 Subject: strdup check missing; noted by nimadeus@pandora.be --- usr.bin/tic/tic.c | 10 +++++++--- 1 file 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; -- cgit v1.2.3