summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2002-12-24 07:40:10 +0000
committerdavidxu <davidxu@FreeBSD.org>2002-12-24 07:40:10 +0000
commitccb03bf540762bed7e69099aadc68ae52d07c155 (patch)
tree40cf3b1839056abbadaad251b7d8e3120ded151d /usr.bin
parentd3c2f878f156c42c0119a330362b1c4cd0945cdb (diff)
downloadFreeBSD-src-ccb03bf540762bed7e69099aadc68ae52d07c155.zip
FreeBSD-src-ccb03bf540762bed7e69099aadc68ae52d07c155.tar.gz
Check NULL pointer to avoid SIGSEGV
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/gencat/genlib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/gencat/genlib.c b/usr.bin/gencat/genlib.c
index 8eaf39c..d0fcefa 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
OpenPOWER on IntegriCloud