From 71f2362aa4ebec211ecf3f4b69f1a173dad81107 Mon Sep 17 00:00:00 2001 From: David Xu Date: Tue, 24 Dec 2002 07:40:10 +0000 Subject: [PATCH] Check NULL pointer to avoid SIGSEGV --- usr.bin/gencat/genlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/gencat/genlib.c b/usr.bin/gencat/genlib.c index 8eaf39c64400..d0fcefa0d38b 100644 --- a/usr.bin/gencat/genlib.c +++ b/usr.bin/gencat/genlib.c @@ -450,7 +450,8 @@ MCReadCat(int fd) static void printS(int fd, const char *str) { - write(fd, str, strlen(str)); + if (str) + write(fd, str, strlen(str)); } static void