summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f1d5b0d)
raw | patch | inline | side by side (parent: f1d5b0d)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 30 Jun 2010 12:48:47 +0000 (12:48 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 30 Jun 2010 12:48:47 +0000 (12:48 +0000) |
The "get_path" function is called at least from "rrdc_update" without
checking for a connection first. In that case the "sd_path" pointer may be
NULL, so dereferencing it without checking for NULL is not good behavior.
This patch checks all arguments of the "get_path" function and returns an
error if any pointer is NULL. -- Florian Forster
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2094 a5681a0c-68f1-0310-ab6d-d61299d08faa
checking for a connection first. In that case the "sd_path" pointer may be
NULL, so dereferencing it without checking for NULL is not good behavior.
This patch checks all arguments of the "get_path" function and returns an
error if any pointer is NULL. -- Florian Forster
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2094 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_client.c | patch | blob | history |
diff --git a/src/rrd_client.c b/src/rrd_client.c
index 18dd0dde44be11f85277a9310353b65f3fe4b8e4..187afb224c3082f0a5c6d6f40fccf5ea6ea1bc33 100644 (file)
--- a/src/rrd_client.c
+++ b/src/rrd_client.c
const char *ret = path;
int is_unix = 0;
+ if ((path == NULL) || (resolved_path == NULL) || (sd_path == NULL))
+ return (NULL);
+
if ((*sd_path == '/')
|| (strncmp ("unix:", sd_path, strlen ("unix:")) == 0))
is_unix = 1;