projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44acfc8
)
Fixed rrdtool sigsegv (datadir==NULL ptr dereferencing)
author
Claudius Zingerli
<gitmail@zeuz.ch>
Tue, 5 Jan 2016 17:22:22 +0000
(18:22 +0100)
committer
Marc Fournier
<marc.fournier@camptocamp.com>
Tue, 12 Jan 2016 06:16:25 +0000
(07:16 +0100)
src/rrdtool.c
patch
|
blob
|
history
diff --git
a/src/rrdtool.c
b/src/rrdtool.c
index
9b04d10
..
7cfdae6
100644
(file)
--- a/
src/rrdtool.c
+++ b/
src/rrdtool.c
@@
-1018,11
+1018,11
@@
static int rrd_config (const char *key, const char *value)
return (1);
}
- len = strlen (
datadir
);
- while ((len > 0) && (
datadir
[len - 1] == '/'))
+ len = strlen (
tmp
);
+ while ((len > 0) && (
tmp
[len - 1] == '/'))
{
len--;
-
datadir
[len] = 0;
+
tmp
[len] = 0;
}
if (len == 0)
@@
-1032,7
+1032,11
@@
static int rrd_config (const char *key, const char *value)
return (1);
}
- sfree (datadir);
+ if (datadir != NULL)
+ {
+ sfree (datadir);
+ }
+
datadir = tmp;
}
else if (strcasecmp ("StepSize", key) == 0)