From 216701ce3ca92b1297a64ffbac21bd2289a6aff4 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 26 Feb 2015 16:34:38 +0100 Subject: [PATCH] Attempt to fix Coverity CID #87810 Dereference null return value Fixes, or rather works around the Coverity warning of possible NULL pointer dereference. (Not an error.) Signed-off-by: Joachim Nilsson --- svc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/svc.c b/svc.c index ad274eea..d157ed57 100644 --- a/svc.c +++ b/svc.c @@ -328,6 +328,8 @@ int svc_register(int type, char *line, char *username) /* Example: inetd ssh@eth0:222/tcp */ if (service) { proto = strchr(service, '/'); + if (!proto) + goto incomplete; *proto++ = 0; port = strchr(service, ':');