From ec6d6769202814c3035d67ec35c3bd6df7effe5c Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 8 Sep 2019 09:35:55 +0200 Subject: [PATCH] Make CopyGraph safe against NULL argument. Otherwise memcpy will fail. --- src/frontend/plotting/graphdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend/plotting/graphdb.c b/src/frontend/plotting/graphdb.c index c4a2d70fb..09ba1dc90 100644 --- a/src/frontend/plotting/graphdb.c +++ b/src/frontend/plotting/graphdb.c @@ -109,6 +109,9 @@ CopyGraph(GRAPH *graph) struct _keyed *k; struct dveclist *link, *newlink; + if (!graph) + return NULL; + ret = NewGraph(); memcpy(ret, graph, sizeof(GRAPH)); /* va: compatible pointer types */