summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-11-15 19:19:47 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-11-15 19:19:47 +0800
commit7bd78c72ef419e02b455494d7f6fcc5c1dac78a7 (patch)
tree47ca6fd28459084c6bf72a2bf31dcbbe15eb0247
parent7e1e5089ec50a0dca311d608939e97fc5fcbdd84 (diff)
downloadpttbbs-7bd78c72ef419e02b455494d7f6fcc5c1dac78a7.tar
pttbbs-7bd78c72ef419e02b455494d7f6fcc5c1dac78a7.tar.gz
pttbbs-7bd78c72ef419e02b455494d7f6fcc5c1dac78a7.tar.bz2
pttbbs-7bd78c72ef419e02b455494d7f6fcc5c1dac78a7.tar.lz
pttbbs-7bd78c72ef419e02b455494d7f6fcc5c1dac78a7.tar.xz
pttbbs-7bd78c72ef419e02b455494d7f6fcc5c1dac78a7.tar.zst
pttbbs-7bd78c72ef419e02b455494d7f6fcc5c1dac78a7.zip
fix a null pointer handling bug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2324 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--innbbsd/bbslink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/innbbsd/bbslink.c b/innbbsd/bbslink.c
index e9ebf143..4fb1931f 100644
--- a/innbbsd/bbslink.c
+++ b/innbbsd/bbslink.c
@@ -1529,8 +1529,8 @@ bntplink(argc, argv)
printf("MYADDR: %s\n", MYADDR);
printf("MYSITE: %s\n", MYSITE);
}
- left = strchr(nl->protocol, '(');
- right = strrchr(nl->protocol, ')');
+ left = nl ? strchr(nl->protocol, '(') : NULL;
+ right = nl ? strrchr(nl->protocol, ')') : NULL;
if (left && right) {
*right = '\0';
strncpy(LINKPROTOCOL, nl->protocol, sizeof LINKPROTOCOL);