From 7501ca1e087fee683a51c7e7473185abde8a0865 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 25 Apr 2025 10:28:28 +0200 Subject: [PATCH] examples: Fix possible pass of NULL into strchr() Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- examples/libssh_scp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/libssh_scp.c b/examples/libssh_scp.c index fc2ceeb7..2c46a036 100644 --- a/examples/libssh_scp.c +++ b/examples/libssh_scp.c @@ -119,6 +119,10 @@ static struct location *parse_location(char *loc) struct location *location = NULL; char *ptr = NULL; + if (loc == NULL) { + return NULL; + } + location = malloc(sizeof(struct location)); if (location == NULL) { return NULL;